<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>报关模板</title>
    <style>

        #outer {
            width: 100%;
            margin: 10px auto;
        }

        #tab {
            overflow: hidden;
            zoom: 1;
            background: #C7CFDF;
            border: 1px solid #D1D1D1;
            padding: 0px;
            margin: 0px;
        }

        #tab li {
            float: left;
            color: #3A3A3A;
            height: 35px;
            cursor: pointer;
            line-height: 35px;
            padding: 0 1.5%;
            width: 30%;
            font-size: 16px;
            font-weight: bold;
            border-right: 1px solid #fff;
        }

        #tab li.current {
            color: #fff;
            background: #2978C0;
        }

        #content {
            border: 1px solid #D1D1D1;
            border-top-width: 0;
        }

        #content ul {
            line-height: 25px;
            display: none;
            margin: 0 30px;
            padding: 10px 0;
        }

        .list_title {
            font-size: 18px;
            margin: 10px 0;
        }

        .list_title1 {
            font-size: 18px;
            margin: 0 0;
        }

        table {
            font-size: 13px
        }

        .table_list_name {
            text-align: right
        }

        .ui-tabs .ui-tabs-panel {
            padding: 0px
        }

        .table_th {
            text-align: center;
        }

        .table-border tr td, .table-border tr th {
            border: 1px solid #000
        }

        .baoguanbtn_style {
            padding: 0px 10px;
            margin: 5px
        }

        /* .disableInput {background-color: #B5B5B5;} */
        .disableInput {
            background-color: #E0E0E0;
        }

        .textInput {
            line-height: 22px;
        }

        td.dataTD {
            /* font-weight: bold; */
            text-align: left;
            /* 	border: 1px solid #8F8888; */
            /* 	white-space: nowrap; */
        }

        #goodsModeInputTB {
            position: absolute;
            position: absolute;
            margin: -200px auto;
            background-color: #999;
            display: none;
            cursor: pointer;
            text-align: right;
        }

        #goodsModeInputTB input {
            width: auto;
            border: 1px solid #333;
        }

        #goodsInfoTB {
            line-height: 24px;
            /**position: absolute;
	left: 10px;**/
            margin-left: 10px;
            top: 0;
        }

        #cnListSelectTB {
            position: absolute;
            position: absolute;
            margin: 30px auto;
            margin-left: 600px;
            background-color: #999;
            display: none;
            cursor: pointer;
            text-align: center;
        }

        #cnListTB {
            position: absolute;
            position: absolute;
            margin: 30px auto;
            margin-left: 600px;
            background-color: #999;
            display: none;
            cursor: pointer;
            text-align: c;
        }

        #doSelCtnDiv {
            position: absolute;
            left: 400px;
            top: 130px;
            background-color: #999;
            display: none;
            z-index: 1;
        }

    </style>
    <%--<jsp:include page="../../head.jsp"/>--%>
    <script type="text/javascript" src="<s:url value="/js/business/declaration.js"/>"></script>
    <script type="text/javascript" src="<s:url value="/js/business/hgdata.js"/>"></script>
    <script type="text/javascript" src="<s:url value="../js/ajaxutil.js"/>"></script>
    <script type="text/javascript"
            src="<s:url value="/js/business/containerNoCheckUtil.js"/>"></script>
    <script type="text/javascript">

        function addGoods(obj) {
            //进入添加时，隐藏保存、提交按钮
//		$("#sumit1").css("display","none");
//		$("#tijiao1").css("display","none");
            var goodsLength = $("#goods_list table tr").length - 1;
            if (goodsLength == 50) {
                alert("报关商品录入项不能超过50项!");
                return;
            }
            var tr = $(obj).parent().parent();
            var d = tr.find("td:eq(5)").text();
            setDefaultValue("#DESTINATION", d);
            setDefaultValue("#GOODS_LEVYMODE", "照章征税");
            setDefaultValue("#CURRENCY", "美元");
            setDefaultValue("#ORIGIN_COUNTRY", "中国");
            setDefaultValue("#ORIGIN_COUNTRY_CODE", "142");
            $("#goods_list").css("display", "none");
            $("#goods_input").css("display", "block");
        }
        function copyGoods(obj) {
            var goodsLength = $("#goods_list table tr").length - 1;
            if (goodsLength == 50) {
                alert("报关商品录入项不能超过50项!");
                return;
            }
            var tr = $(obj).parent().parent().html();
            $("#goods_list table").append($("<tr>" + tr + "</tr>"));
            $("#goods_list table tr:last").find("td[name=ID]").html("");//设置复制那行的ID为空
//		$("#goods_list table tr:last").find("td[name=GOODS_MODE]").html("");//设置复制那行的要素为空
            reflashIndex();
        }

        var suifudate = (new Date()).getTime();
        // <<<<<<< HEAD
        // =======
        function upGoods(obj) {
            var trArr = [];
            var cindex = ($(obj).parent().parent().find("td[name='INDEX']").text())
            if (cindex > 1) {
                $.each($("#goods_list table tr"), function () {
                    if ($(this).find("td[name='INDEX']").text() == cindex) {
                        var pre = trArr.pop();
                        trArr.push($(this).html())
                        trArr.push(pre)
                    }
                    else {
                        trArr.push($(this).html())
                    }
                })
                $("#goods_list table").empty()
                for (var i in trArr) {
                    $("#goods_list table").append($("<tr>" + trArr[i] + "</tr>"));
                }
                reflashIndex();
            }
        }
        function downGoods(obj) {
            var goodsLength = $("#goods_list table tr").length - 1;

            var trArr = [];
            var cindex = ($(obj).parent().parent().find("td[name='INDEX']").text())
            if (cindex < goodsLength) {
                var skip = false;
                $.each($("#goods_list table tr"), function () {
                    if (!skip) {
                        if ($(this).find("td[name='INDEX']").text() == cindex) {
                            skip = true;
                        }
                        trArr.push($(this).html())
                    }
                    else {
                        var pre = trArr.pop();
                        trArr.push($(this).html())
                        trArr.push(pre)
                    }
                })
                $("#goods_list table").empty()
                for (var i in trArr) {
                    $("#goods_list table").append($("<tr>" + trArr[i] + "</tr>"));
                }
                reflashIndex();
            }
        }
        // >>>>>>> refs/heads/luob
        $.ajax({
                   url: "hgdata-initData",
                   success: function (data) {
                       var customs = data.data.HGD_2;
                       var tradeMode = data.data.HGD_8;
                       var levyMode = data.data.HGD_6;
                       var lcMode = data.data.HGD_4;
                       var dealMode = data.data.HGD_9;
                       var addr = data.data.HGD_3;
                       var arrivedCountryMode = data.data.HGD_0;
                       var goodsCurrencyMode = data.data.HGD_1;
                       //已做全局定义
                       zhengMian = data.data.HGD_5;
                       arrivedCountryMode1 = data.data.HGD_0;
                       goodsCurrencyMode1 = data.data.HGD_1;
                       if ($("#declareLevymode_1").val() == "undefined" || $(
                                       "#declareLevymode_1").val() == "") {
//				autoMethod($("#declareCode_t"));//20140611
                           autoZhengMian($("#declareLevymode_1"));
                       }
                       var goods_levymode = data.data.HGD_5;
                       //参数中加了一个#
// 		initDropDown("#export_show", "#export", customs,0);
                       initDropDown("#TRADE_MODE_SHOW", "#TRADE_MODE", tradeMode, 1);
                       initDropDown("#LEVYMODE_SHOW", "#LEVYMODE", levyMode, 1);
                       initDropDown("#LC_TYPE_SHOW", "#LC_TYPE", lcMode, 0);
                       initDropDown("#DEAL_MODE_SHOW", "#DEAL_MODE", dealMode, 0);
                       initDropDown("#GOODS_ADDR_SHOW", "#GOODS_ADDR", addr, 0);
                       initDropDown("#TRADING_COUNTRY", "#TRADING_COUNTRY_CODE", arrivedCountryMode,
                                    0);//贸易国
// 		initDropDown("#OTHER_GOODS_ADDR_SHOW", "#OTHER_GOODS_ADDR", addr,0);
                       initDropDown("#ARRIVED_COUNTRY_SHOW", "#ARRIVED_COUNTRY", arrivedCountryMode,
                                    0);
                       initDropDown("#ARRIVED_PORT_SHOW", "#ARRIVED_PORT", arrivedCountryMode, 0);
                       initDropDown("#DESTINATION", "#DESTINATION_CODE", arrivedCountryMode, 0);
                       initDropDown("#ORIGIN_COUNTRY", "#ORIGIN_COUNTRY_CODE", arrivedCountryMode,
                                    0);
                       initDropDown("#CURRENCY", "#CURRENCY", goodsCurrencyMode, 1);
                       initDropDown("#GOODS_LEVYMODE", "#GOODS_LEVYMODE", goods_levymode, 1);
                       initDropDown("#FREIGHT3_SHOW", "#FREIGHT3", goodsCurrencyMode, 1);
                       initDropDown("#PREMIUM3_SHOW", "#PREMIUM3", goodsCurrencyMode, 1);
                       initDropDown("#OTHERFEEL3_SHOW", "#OTHERFEEL3", goodsCurrencyMode, 1);
                   }
               });

        /**
         *初始化报关下拉框
         *@param showid 显示用的输入框
         *@param setValueId 保存正式值的输入框
         *@param data 数据源
         */
        function initDropDown(showid, setValueId, data, minlen) {
            var obj = $(showid);
            var objValueInput = $(setValueId);
            var datasource = new Array();
            if (minlen == 0) {

            } else if (minlen == "" || minlen == undefined || minlen == null) {
                minlen = 2;
            }
            $.each(data, function (i, n) {
                datasource.push(n.code + " " + n.name);
            });
            obj.autocomplete({
                                 minLength: minlen, source: datasource,
                                 autoFocus: true, delay: 0, select: function (event, ui) {
                    var s = ui.item.label;
                    var s_num = s.substring(0, 3);
                    if (s_num == "242" || s_num == "217" || s_num == "113" || s_num == "246"
                        || s_num == "139") {
                        alert("特别提示：出口该国家须做装运前检验！");
                    }

                    objValueInput.val(s.substring(0, s.indexOf(" ")));
                    obj.val(s.substring(s.indexOf(" ") + 1, s.length));
                    var objArray = $("#outer input[id][type!=hidden][disabled!=disabled]");
                    var inputIndex = getIndex(objArray);
                    var nextInput = objArray.eq(++inputIndex);
                    nextInput.select();
                    return false;
                }
                             });
            if (minlen == 0) {
                //	obj.bind("focus",function(event){obj.autocomplete("search");});
                //	obj.bind("click",function(event){obj.autocomplete("search");});
                dropdownClickEvent(showid);
            }
        }

        //包装方式下拉框
        dropdownClickEvent("#packet_type");
        $("#GOODS_PACKAGE").autocomplete({
                                             autoFocus: true,
                                             minLength: 0,
                                             source: function (request, response) {
                                                 var term = request.term;
                                                 var data = goodspackage_type;
                                                 var d = $.map(data, function (item) {
                                                     return {
                                                         label: item.code + " " + item.name,
                                                         code: item.code,
                                                         name: item.name
                                                     };
                                                 });
                                                 var matcher = new RegExp($.ui.autocomplete.escapeRegex(
                                                         request.term), "i");
                                                 response($.grep(d, function (value) {
                                                     value = value.label;
                                                     return matcher.test(value);
                                                 }));
                                             }, select: function (event, ui) {
                $(this).val(ui.item.name);
                if (ui.item.name == "其它") {
                    $("#CONCRETE_GOODS_PACKAGE").show();
                    $("#CONCRETE_GOODS_PACKAGE").select();
                } else {
                    $("#CARTON").select();
                }
                return false;
            }
                                         });

        //柜号类型下拉(进出闸口、码头内装)
        // $("#WORK_TYPE").autocomplete({
        // 	autoFocus : true,
        // 	minLength : 0,
        // 	source : function(request, response) {
        // 		var term = request.trem;
        // 		var data = work_type;
        // 		var d = $.map(data, function(item) {
        // 			return {label:item.name,code:item.code,name:item.name};
        // 		});
        // 		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
        // 		response( $.grep( d, function( value ) {
        // 	          value = value.label;
        // 	          return matcher.test( value );
        // 	        }) );
        // 	}, select : function(event, ui) {
        // 		$(this).val(ui.item.name);
        // // 		$("#EXPORT_PORT_CODE").val(ui.item.code);
        // 		return false;
        // 	}
        // });

        //当包装种类为其他时备注值的设置
        $("#CONCRETE_GOODS_PACKAGE").bind("blur", function () {
            var CONCRETE_GOODS_PACKAGE = $("#CONCRETE_GOODS_PACKAGE").val();
            var OTHER_GOODS_ADDR_SHOW = $("#OTHER_GOODS_ADDR_SHOW").val();
            if (CONCRETE_GOODS_PACKAGE != "") {
                if (OTHER_GOODS_ADDR_SHOW != "") {
                    $("#REMARK").val(
                            $("#DECLARATION_PORT").val() + ",结汇,退税; 其他货源地：" + OTHER_GOODS_ADDR_SHOW
                            + "; 包装种类：" + CONCRETE_GOODS_PACKAGE);
                } else {
                    $("#REMARK").val($("#DECLARATION_PORT").val() + ",结汇,退税; 包装种类：" + $(
                                             "#CONCRETE_GOODS_PACKAGE").val());
                }
            } else {
                if (OTHER_GOODS_ADDR_SHOW != "") {
                    $("#REMARK").val($("#DECLARATION_PORT").val() + ",结汇,退税; 其他货源地："
                                     + OTHER_GOODS_ADDR_SHOW);
                } else {
                    $("#REMARK").val($("#DECLARATION_PORT").val() + ",结汇,退税");
                }

            }
        });

        //运费下拉
        $("#FREIGHT1").autocomplete({
                                        autoFocus: true,
                                        minLength: 0,
                                        source: function (request, response) {
                                            var term = request.term;
                                            var data = fee1;
                                            var d = $.map(data, function (item) {
                                                return {
                                                    label: item.code + " " + item.name,
                                                    code: item.code,
                                                    name: item.name
                                                };
                                            });
                                            var matcher = new RegExp($.ui.autocomplete.escapeRegex(
                                                    request.term), "i");
                                            response($.grep(d, function (value) {
                                                value = value.label;
                                                return matcher.test(value);
                                            }));
                                        }, select: function (event, ui) {
                $(this).val(ui.item.name);
                return false;
            }
                                    });

        //保费下拉
        $("#PREMIUM1").autocomplete({
                                        autoFocus: true,
                                        minLength: 0,
                                        source: function (request, response) {
                                            var term = request.term;
                                            var data = fee1;
                                            var d = $.map(data, function (item) {
                                                return {
                                                    label: item.code + " " + item.name,
                                                    code: item.code,
                                                    name: item.name
                                                };
                                            });
                                            var matcher = new RegExp($.ui.autocomplete.escapeRegex(
                                                    request.term), "i");
                                            response($.grep(d, function (value) {
                                                value = value.label;
                                                return matcher.test(value);
                                            }));
                                        }, select: function (event, ui) {
                $(this).val(ui.item.name);
                return false;
            }
                                    });

        //杂费下拉
        $("#OTHERFEEL1").autocomplete({
                                          autoFocus: true,
                                          minLength: 0,
                                          source: function (request, response) {
                                              var term = request.term;
                                              var data = fee1;
                                              var d = $.map(data, function (item) {
                                                  return {
                                                      label: item.code + " " + item.name,
                                                      code: item.code,
                                                      name: item.name
                                                  };
                                              });
                                              var matcher = new RegExp($.ui.autocomplete.escapeRegex(
                                                      request.term), "i");
                                              response($.grep(d, function (value) {
                                                  value = value.label;
                                                  return matcher.test(value);
                                              }));
                                          }, select: function (event, ui) {
                $(this).val(ui.item.name);
                return false;
            }
                                      });

        var unitData;
        //成交/法定单位
        $.ajax({
                   url: "../base/dropdown-unit",
                   success: function (data) {
                       var sourcedata = $.map(data, function (item) {
                           return {label: item[1] + " " + item[0], id: item[1], name: item[0]};
                       });
                       unitData = sourcedata;
                       $("#UNIT,#LEGAL_UNIT,#SECOND_UNIT").autocomplete({
                                                                            minLength: 1,
                                                                            autoFocus: true,
                                                                            matchContains: true,
                                                                            delay: 0,
                                                                            source: sourcedata,
                                                                            select: function (event,
                                                                                              ui) {
                                                                                var s = ui.item.label;
                                                                                $(this).val(
                                                                                        s.substring(
                                                                                                s.indexOf(
                                                                                                        " ")
                                                                                                + 1,
                                                                                                s.length));
                                                                                $("#TOTAL_PRICE").select();
                                                                                return false;
                                                                            }
                                                                        });
                   }
               });
        dropdownClickEvent("#SELLER");
        $("#SELLER").autocomplete({
                                      minLength: 1, autoFocus: true, delay: 0,
                                      source: function (request, response) {
                                          $.ajax({
                                                     url: "companyqp-findCompanyByCode?tdateaa="
                                                          + timeNum(),
                                                     dataType: "json",
                                                     type: "post",
                                                     data: {
                                                         k: request.term
                                                     },
                                                     success: function (data) {
                                                         response($.map(data,
                                                                        function (item) {
                                                                            return {
                                                                                label: item[1] + " "
                                                                                       + item[0],
                                                                                id: item[1],
                                                                                name: item[0],
                                                                                address: item[2],
                                                                                phone: item[3],
                                                                                fax: item[4]
                                                                            };
                                                                        }));
                                                     }
                                                 });
                                      },
                                      select: function (event, ui) {
                                          if (ui.item.id == "") {
                                              /*jw.dialog({
                                               iframe: "businessUnits-add",
                                               width: 400,
                                               height: 200,
                                               over: false
                                               });*/
                                              layer.open({
                                                             type: 2,
                                                             title: '添加单位',
                                                             area: ["500px", "350px"],
                                                             offset: 't',
                                                             content: "/business/companyQp/frame_to_add_companyQP",
                                                             success: function (layero, index) {
                                                                 var f = layero.find("iframe")[0];
                                                                 var contentHeight = f.contentDocument.body.scrollHeight;
                                                                 var position = layero.position();
                                                                 var __top = position.top;
                                                                 var __left = position.left - 100;
                                                                 if ((contentHeight + __top)
                                                                     > 500) {
                                                                     __top =
                                                                             window.document.body.scrollTop;
                                                                 }
                                                                 layero.offset(
                                                                         {
                                                                             top: __top,
                                                                             left: __left
                                                                         });
                                                                 $(f).height(contentHeight * 0.8);
                                                                 dp.find("input.search").val("");
                                                                 dp.dropdown("hide");
                                                             }
                                                         });
                                          } else {
                                              var s = ui.item.label;
                                              console.log(ui.item);
                                              var s_num = s.substring(0, s.indexOf(" "));
                                              var s_company_name = s.substring(s.indexOf(" ") + 1,
                                                                               s.length);
                                              var address = ui.item.address == 'null' ? ""
                                                      : ui.item.address;
                                              var phone = ui.item.phone == 'null' ? ""
                                                      : ui.item.phone;
                                              var fax = ui.item.fax == 'null' ? "" : ui.item.fax;
                                              $("#SELLER").val(s_company_name);
                                              $("#FAHUO_COMPANY_CO").val(s_num);
                                              $("#FAHUO_COMPANY_NAME").val(s_company_name);
                                              $("#COMPANY_CO").val(s_num);
                                              $("#COMPANY_NAME").val(s_company_name);
                                              $("#SELLER_ADDRESS").val(address);
                                              $("#SELLER_PHONE").val(phone);
                                              $("#SELLER_FAX").val(fax);
                                              if (s_num.substring(5, 6) == "4") {
                                                  $("#LEVYMODE_SHOW").val("外资企业");
                                                  $("#LEVYMODE").val("603");
                                              } else if (s_num.substring(5, 6) == "2") {
                                                  $("#LEVYMODE_SHOW").val("中外合作");
                                                  $("#LEVYMODE").val("602");
                                              } else if (s_num.substring(5, 6) == "3") {
                                                  $("#LEVYMODE_SHOW").val("中外合资");
                                                  $("#LEVYMODE").val("601");
                                              }
                                          }
                                          $("#SELLER_ADDRESS").select();
                                          return false;
                                      }
                                  });

        /**
         * 发货单位下拉
         */
        $.ajax({
                   url: "companyqp-findCompanyByCode?tdateaa=" + timeNum(),
                   success: function (data) {
                       var sourcedata = $.map(data, function (item) {
                           return {label: item[1] + " " + item[0], id: item[1], name: item[0]};
                       });
                       $("#FAHUO_COMPANY_NAME").autocomplete({
                                                                 minLength: 1,
                                                                 autoFocus: true,
                                                                 delay: 0,
                                                                 source: sourcedata,
                                                                 select: function (event, ui) {
                                                                     var s = ui.item.label;
                                                                     $("#FAHUO_COMPANY_CO").val(
                                                                             s.substring(0,
                                                                                         s.indexOf(
                                                                                                 " ")));
                                                                     $("#FAHUO_COMPANY_NAME").val(
                                                                             s.substring(
                                                                                     s.indexOf(" ")
                                                                                     + 1,
                                                                                     s.length));
                                                                     return false;
                                                                 }
                                                             });
                   }
               });

        [{"code": "0", "id": "2789", "name": "非保税区"},
            {"code": "1", "id": "2790", "name": "监管仓库"},
            {"code": "2", "id": "2791", "name": "水路运输"},
            {"code": "3", "id": "2792", "name": "铁路运输"},
            {"code": "4", "id": "2793", "name": "公路运输"},
            {"code": "5", "id": "2794", "name": "航空运输"},
            {"code": "6", "id": "2795", "name": "邮件运输"},
            {"code": "7", "id": "2796", "name": "保税区"},
            {"code": "8", "id": "2797", "name": "保税仓库"},
            {"code": "9", "id": "2798", "name": "其它运输"},
            {"code": "H", "id": "2799", "name": "边境特殊"},
            {"code": "W", "id": "2800", "name": "物流中心"},
            {"code": "X", "id": "2801", "name": "物流园区"},
            {"code": "Y", "id": "2802", "name": "保税港区"},
            {"code": "Z", "id": "2803", "name": "出口加工"}]
        /**
         * 运输方式下拉框
         */
        $("#TRANSPORT_MODE").autocomplete({
                                              minLength: 0, autoFocus: true, delay: 0,
                                              source: [{
                                                  "code": "0",
                                                  "value": "2789",
                                                  "label": "0 非保税区"
                                              },
                                                  {"code": "1", "value": "监管仓库", "label": "1 监管仓库"},
                                                  {"code": "2", "value": "水路运输", "label": "2 水路运输"},
                                                  {"code": "3", "value": "铁路运输", "label": "3 铁路运输"},
                                                  {"code": "4", "value": "公路运输", "label": "4 公路运输"},
                                                  {"code": "5", "value": "航空运输", "label": "5 航空运输"},
                                                  {"code": "6", "value": "邮件运输", "label": "6 邮件运输"},
                                                  {"code": "7", "value": "保税区", "label": "7 保税区"},
                                                  {"code": "8", "value": "保税仓库", "label": "8 保税仓库"},
                                                  {"code": "9", "value": "其它运输", "label": "9 其它运输"},
                                                  {"code": "H", "value": "边境特殊", "label": "H 边境特殊"},
                                                  {"code": "W", "value": "物流中心", "label": "W 物流中心"},
                                                  {"code": "X", "value": "物流园区", "label": "X 物流园区"},
                                                  {"code": "Y", "value": "保税港区", "label": "Y 保税港区"},
                                                  {
                                                      "code": "Z",
                                                      "value": "2803",
                                                      "label": "Z 出口加工"
                                                  }],
                                              select: function (event, ui) {
                                                  $("input[name='transport_mode_code']").val(
                                                          ui.item.code);
                                                  return true;
                                              }
                                          });
        dropdownClickEvent("#TRANSPORT_MODE");

        /**
         * 设置默认值方法
         */
        function setDefaultValue(inputSelect, value) {
            if ($(inputSelect).val() == "" || $(inputSelect).val() == undefined || $(
                            inputSelect).val() == null) {
                $(inputSelect).val(value);
            }
        }

        //根据目的地值设置
        $("#DESTINATION").bind("blur", function () {
            var DESTINATION = $("#DESTINATION").val();
            $("#ARRIVED_PORT").val(DESTINATION);
            $("#ARRIVED_COUNTRY").val(DESTINATION);
        });

        //计算货物单价 填写总价或者填写计价数量
        $("#TOTAL_PRICE, #COUNT").bind("blur", function () {
            var count = new Number($("#COUNT").val());
            var price = new Number($("#TOTAL_PRICE").val());
            var unit_price = Math.round((price / count) * 10000) / 10000;
            $("#UNIT_PRICE").val(unit_price.toFixed(4));
        });

        //通过手册号锁定费用输入框
        $("#RECORD_ID").bind("blur", function (event) {
            if ($("#RECORD_ID").val() == "") {

            } else {
                initBeiAnMode();
            }
        });

        //检查手册号长度
        function checkRECORD_ID() {
            var test = $("#RECORD_ID").val();
            if (test.length > 0 && test.length != 12) {
                alert("备案号长度不正确，标准长度为12，请检查输入");
                $("#RECORD_ID").focus();
            }
        }

        //关于不同手册号类型其他值的设定
        function initBeiAnMode() {
            var RECORD_ID = $("#RECORD_ID").val();
            if (RECORD_ID.charAt(0) == "C") {
                $("#TRADE_MODE_SHOW").val("进料对口");
                $("#LEVYMODE_SHOW").val("进料加工");
                $("#GOODS_LEVYMODE").val("全免");
            }
            else if (RECORD_ID.charAt(0) == "B") {
                $("#TRADE_MODE_SHOW").val("来料加工");
                $("#LEVYMODE_SHOW").val("来料加工");
                $("#GOODS_LEVYMODE").val("全免");
            } else if (RECORD_ID.charAt(0) == "E") {
                $("#TRADE_MODE_SHOW").val("进料对口");
                $("#LEVYMODE_SHOW").val("来料加工");
                $("#GOODS_LEVYMODE").val("全免");
                $("#versionNoTitle").show();
                $("#versionNoValue").show();
            }
            initBeiAn();
        }

        function initBeiAn() {
            var tm = $("#TRADE_MODE").val();
            if (tm == "一般贸易") {
                $("#HANDBOOK_ITEM_NO").attr("disabled", true);
                $("#HANDBOOK_ITEM_NO").attr("class", "disableInput");
            } else {
                $("#HANDBOOK_ITEM_NO").attr("disabled", false);
                $("#HANDBOOK_ITEM_NO").bind("keypress", function (event) {
                    if (event.keyCode == 13) {
                        $("#NAME").focus();
                    }
                });
                $("#HANDBOOK_ITEM_NO").focus();
            }
        }

        //进入页面加载的内容

        $(function () {
            var declareId = $("#declareId").val()
            var isRecordInfo_val = $("#isRecordInfo_val").val();
            var isRecordInfo = $("#isRecordInfo").val();
            var isRecordInfo_model = $("#isRecordInfo_model").val();
            if (declareId == null || declareId == "") {
                if (isRecordInfo_val == "T" || isRecordInfo_val == "F") {
                    $("#isRecordInfo").val(isRecordInfo_val);
                    isRecordInfo = isRecordInfo_val;
                }
                if (isRecordInfo_model == "T" || isRecordInfo_model == "F") {
                    $("#isRecordInfo").val(isRecordInfo_model);
                    isRecordInfo = isRecordInfo_model;
                }
            }
            if ($("#declaration_sup_id").val() == null || $("#declaration_sup_id").val() == "") {
// 		$("#declaration_sup_id").val("佛港报关");
// 		$("#declaration_sup").val("402881e93cf50c90013cf51f40b60000");
                $("#orderSave").hide();
                if ($("#modelTypeInfo").val() == "1") {
                    $("#goods_input").hide();
                    $("#goods_list").show();
                }
            } else {
                $("#goods_input").hide();
                $("#goods_list").show();
            }
            //获取佛港报关报关费
// 	$.ajax({
// 		url : "declarationOffer-getDeclarationOfferFree?com_id="+$("#declaration_sup").val(),
// 		dataType : "json",
// 		type : "post",
// //			data : {
// //				com_id : ui.item.id
// //			},
// 		success : function(data) {
// 			if(data.declarationOffer!=null) {
// 				$("#declarationFree").text(data.declarationOffer.declaration_amount);
// 				if(data.declarationOffer.container_amount == "" || data.declarationOffer.container_amount == 0) {
// 					$("#containerNum_val").hide();
// 					$("#containerNum").hide();
// 				} else {
// 					$("#containerNum").text(data.declarationOffer.container_amount);
// 					$("#containerNum_val").show();
// 					$("#containerNum").show();
// 				}
// 				if(data.declarationOffer.remark == "") {
// 					$("#offer_remark").hide();
// 				} else {
// 					$("#offer_remark").val(data.declarationOffer.remark);
// 				}
// 				$("#showDeclarationFree").show();
// 			} else {
// 				$("#showDeclarationFree").hide();
// 			}
// 		}
// 	});

// 	$("#EXPORT_DATE").datepicker();//初始化时间控件
            $("#CONTRACT_DATE").datepicker();//初始化签约时间

            $("#CONTRACT_DATE").datepicker("option", "onClose", function (dateText, inst) {
                //里边写你光标切换功能
                $("#CONTRACT_NO").focus();
            });

            //导入模板时如果包装种类是其它显示具体包装种类
            var goods_package = $("#GOODS_PACKAGE").val();
            if (goods_package == "其它") {
                $("#CONCRETE_GOODS_PACKAGE").show();
            }
            //下单时判断是否手册，是否显示手册信息
            if (isRecordInfo == "F") {
                $("#RECORD_ID_DIV").hide();
                $("#handBookItemNoTile").hide();
                $("#handBookItemNoValue").hide();

            } else if (isRecordInfo == "T") {
                //隐藏要素
                $("#goodsModeTitle").hide();
                $("#goodsModeValue").hide();
            }
            //进入修改页面时判断是否是手册
// 	if((declareId != "") && $("#RECORD_ID").val() == "") {
            if (isRecordInfo == "F") {
                $("#RECORD_ID_DIV").hide();
                $("#handBookItemNoTile").hide();
                $("#handBookItemNoValue").hide();
                $("#versionNoTitle").hide();
                $("#versionNoValue").hide();
            }
            //进入修改页面时判断是否是手册,隐藏要素
            if (isRecordInfo == "T") {
                //隐藏要素
                $("#goodsModeTitle").hide();
                $("#goodsModeValue").hide();
            }

            var RECORD_ID = $("#RECORD_ID").val();

            $("#versionNoTitle").hide();
            $("#versionNoValue").hide();
            if (RECORD_ID.charAt(0) == "E") {
                $("#versionNoTitle").show();
                $("#versionNoValue").show();
            }

            //导入模板时判断是否手册
// 	if(RECORD_ID == "" && isRecordInfo == "") {
            if (isRecordInfo_model == "F") {
                $("#RECORD_ID_DIV").hide();
                $("#handBookItemNoTile").hide();
                $("#handBookItemNoValue").hide();
            }
            if (isRecordInfo_model == "T") {
                $("#goodsModeTitle").hide();
                $("#goodsModeValue").hide();
            }
            var $li = $('#tab li');
            var $ul = $('#content ul');
            $li.click(function () {
                var $this = $(this);
                var $t = $this.index();
                $li.removeClass();
                $this.addClass('current');
                $ul.css('display', 'none');
                $ul.eq($t).css('display', 'block');
                if ($t == 0) {
                    /* if($("#RECORD_ID").val()!="") {
                     $("#RECORD_ID_DIV").show();
                     } else {
                     $("#RECORD_ID_DIV").hide();
                     } */
                } else if ($t == 1) {
                    //$("#RECORD_ID_DIV").hide();
                    $("#SELLER").focus();
                } else if ($t == 2) {
                    //$("#RECORD_ID_DIV").hide();
                    $("#orderSave").show();
                } else {
                    //$("#RECORD_ID_DIV").hide();
                }
            });

            //有无木质包装选择框设值
            var is_wood_packaging = "${declare.is_wood_packaging}";
            if (is_wood_packaging == "1") {
                $("#noWoodPackaging").attr("checked", true);
            } else if (is_wood_packaging == "2") {
                $("#woodPackaging").attr("checked", true);
            }

            //初始化上传功能
            var option = {
                success: function showResponse(responseText,
                                               statusText, xhr, $form) {
                    console.log(responseText);
                    jw.close();
                    var data = responseText;
                    $("#containerInfoId").val(data.data[0]);
                    $("#containInfo table tr:eq(1) td:eq(0)").html(data.data[1]);
                }
            };
            $("#uploadAccessoryForm").ajaxForm(option);

            //柜货散货选择
            $(':checkbox[name=containerType]').each(function () {
                $(this).click(function () {
                    $(':checkbox[name=containerType]').removeAttr('checked');
                    $(this).attr('checked', 'checked');
                });
            });

            $("#cnListSelectTB").hide();
            $("#cnListTB").hide();

            //修改页面加载柜量信息
            var containerList = $("#CONTAINER_NO_INFO").val();
            if (containerList != "") {
                containerList = eval(containerList);
                var output = "";
                var count;
                for (var i = 0; i < containerList.length; i++) {
                    count = i + 1;
                    output = "<tr>";
                    output += "<td class='cn_data_count' style=\"width:35px;\">" + count + "</td>";
                    output +=
                            "<td class='cn_data' style=\"width:180px;\">"
                            + containerList[i].CONTAINER_NO + "</td>";
                    output +=
                            "<td class='cn_data' style=\"width:60px;\">" + containerList[i].CT_SIZE
                            + "</td>";
                    output +=
                            "<td class='cn_data hiddenValue' style=\"width:80px;\">" + $(
                                    "#weight_input").val() + "</td>";
                    output += "<td class='hiddenValue'></td>";
                    output += "</tr>";
                    $("#cnListTB").append(output);
                }
            }

            //页面加载时隐藏报关行价格显示
            $("#showDeclarationFree").hide();
        });

        function choseContainerType(type) {
            if (type == 'gh') {

            }
        }

        var goodsCodeEdit = "";
        function initGoodsCodeEdit() {
            if ($("#goods_code_t").val().length == 8) {
                goodsCodeEdit = $("#goods_code_t").val();
            }
        }

        /**
         *商品编号下拉
         */
        var code_t_old = "";
        var code_s_old = "";
        var isEdit = "";
        var codes = new Array();
        $("#CODE_T").autocomplete({
                                      minLength: 5,
                                      autoFocus: true,
                                      matchContains: true,
                                      source: function (request, response) {
                                          var data = {k: $("#CODE_T").val()};
                                          $.ajax({
                                                     url: "goodscode-findGoodsCode?tdateaa="
                                                          + timeNum(),
                                                     data: data,
                                                     success: function (data) {
                                                         codes = data.content;
                                                         response(
                                                                 $.map(data.content,
                                                                       function (item) {
                                                                           return {
                                                                               label: item.cODE_T
                                                                                      + "."
                                                                                      + item.cODE_S
                                                                                      + " "
                                                                                      + item.g_NAME,
                                                                               CODE_S: item.cODE_S,
                                                                               CODE_T: item.cODE_T,
                                                                               GOODS_MODE: item.gOODS_MODE,
                                                                               UNIT_1: item.uNIT_1,
                                                                               UNIT_2: item.uNIT_2,
                                                                               G_NAME: item.g_NAME
                                                                           };
                                                                       }));
                                                     }
                                                 });
                                      },
                                      select: function (event, ui) {
                                          $(this).val(ui.item.CODE_T);
                                          var GOODS_MODE = $("#GOODS_MODE").val();
                                          if (GOODS_MODE != "") {
                                              isEdit = 1;
                                              loadGoodsCode(ui.item, isEdit);
                                          } else {
                                              isEdit = 2;
                                              loadGoodsCode(ui.item, isEdit);
                                          }
                                          return false;
                                      }
                                  });
        //保证选择后，再点击能够加载表格
        $("#CODE_T").on("click", function () {
            $(this).autocomplete("search");
        });

        var isRecord = $("#isRecordInfo").val();
        var RECORD_ID = $("#RECORD_ID").val();
        $("#GOODS_MODE").parent().bind("click", function () {
            var data = {k: $("#CODE_T").val()};
            $.ajax({
                       url: "goodscode-findGoodsCode?tdateaa=" + timeNum(),
                       data: data,
                       success: function (data) {
                           codes = data.content;
                           /*
                            *手册类型可以手填规格型号，非手册类型可以点击弹出窗口
                            */
                           $.map(data.content, function (item) {
                               if (isRecord && isRecord == "T") {
                               } else if (isRecord && isRecord == "F") {
                                   loadGoodsMode(item.cODE_T, item.cODE_S, item.gOODS_MODE, 1);
                               } else if (RECORD_ID && RECORD_ID != "") {
                               } else if (!RECORD_ID || RECORD_ID == "") {
                                   loadGoodsMode(item.cODE_T, item.cODE_S, item.gOODS_MODE, 1);
                               }
                           });
                       }
                   });
        });

        /**
         *商品编号
         */
        function loadGoodsCode(item, isEdit) {
            if ($("#HANDBOOK_ITEM_NO").val() == "") {
                loadGoodsMode(item.CODE_T, item.CODE_S, item.GOODS_MODE, isEdit);
            } else {
                $("#COUNT").focus();
                $("#COUNT").select();
            }

            var CODE_T = item.CODE_T;
            var CODE_S = item.CODE_S;
            var G_NAME = item.G_NAME;

            var UNIT_1 = parseUnitDataToChn(item.UNIT_1);
            var UNIT_2 = parseUnitDataToChn(item.UNIT_2);
            $("#CODE_T").val(CODE_T);
            if (CODE_S != "N") {
                $("#CODE_S").val(CODE_S);
            } else {
                $("#CODE_S").val("00");
            }
            if (goodsCodeEdit != CODE_T) {

                if ($("#UNIT").val() == "") {
                    $("#UNIT").val(UNIT_1);
                }
                $("#LEGAL_UNIT").val(UNIT_1);
                $("#SECOND_UNIT").val(UNIT_2);
                if (UNIT_2 == "" || UNIT_2 == null || UNIT_2 == undefined) {
                    $("#SECOND_COUNT").attr("disabled", true);
                    $("#SECOND_COUNT").attr("class", "disableInput");
                } else {
                    $("#SECOND_COUNT").attr("disabled", false);
                    $("#SECOND_COUNT").attr("class", "");
                }
            } else {
                goodsCodeEdit = "";
            }
            initSecondUnit();
        }

        function initSecondUnit() {
            var su = $("#SECOND_UNIT").val();
            if (su == null || su == "") {
                $("#SECOND_COUNT").attr("disabled", true);
                $("#SECOND_COUNT").attr("class", "disableInput");
            } else {
                $("#SECOND_COUNT").attr("disabled", false);
                $("#SECOND_COUNT").attr("class", "");
            }
        }

        function loadGoodsMode(code_t, code_s, goods_mode, isEdit) {
            if (goods_mode == null) {
                //mode: 0get,1update
                $.ajax({
                           url: "goodscode-getGoodsMode?code_t=" + code_t + "&code_s=" + code_s,
                           async: false,
                           success: function (data) {
                               alert(data);
                               if (data != null) {
                                   alert($.parseJSON(data.msg));
                                   if ($.parseJSON(data.msg).state == "0") {
                                       alert($.parseJSON(data.msg).msg);
                                       return false;
                                   } else if ($.parseJSON(data.msg).state == "1") {
                                       goods_mode = $.parseJSON(data.msg).msg;
                                   }
                               }
                           }
                       });
            }
            var re = /:[^;]*;/g;
            var arr = goods_mode.match(re);
            var output = "";
            var length = arr.length;
            var gmodeVal = $("#GOODS_MODE").val();
            gmodeVal = gmodeVal.substring(0, gmodeVal.length);
            gmodeVal = gmodeVal.split("|");
            for (var x = 0; x < length; x++) {
                if (x == 0 && arr[x].indexOf("品名") != -1) {
                    continue;
                }
                var label = arr[x];
                label = label.replace(/:/, "");
                label = label.replace(/;/, "");
                var labelVal = gmodeVal[x];
                //如果列表中出现undefined的情况，就把labelVal设为空
                if (labelVal == undefined) {
                    labelVal = "";
                }
                var tid = "gmtr_" + x;
                var inputId = "gminput_" + x;
                if (isEdit == "2") {
                    output +=
                            "<tr id='" + tid + "'><td>" + label + "</td>"
                            + "<td><input type='text' class='goodsModeInput'  /></td></tr>";
                } else if (isEdit == "1") {
                    output +=
                            "<tr id='" + tid + "'><td>" + label + "</td>" + "<td><input id='"
                            + inputId + "' type='text' class='goodsModeInput' value='" + labelVal
                            + "'  /></td></tr>";
                }

            }
            // 		output += "</tr>";
            output +=
                    "<tr><td align='right'><input id='goodsCode' type='button' onclick='setGoodsMode()' value='确定' /></td>"
                    + "<td align='left'><input id='goodsCodeCel' value='取消' type='button' onclick='cancel()' /></td></tr>";
            $("#goodsModeInputTB").html("");
            $("#goodsModeInputTB").append(output);
            $("#goodsModeInputTB").css("left", (document.body.offsetWidth - parseInt(200)) / 2);
            $("#goodsModeInputTB").show();
            //set data
            $("#GOODS_MODE").val().split("|");
            $("#goodsModeInputTB input").first().focus();
            initEnterKey();
        }

        function initEnterKey() {
            var goodsModel = $("#goodsModeInputTB");
            var goodsInput = $("#goodsModeInputTB input");
            if (goodsModel.length != 0) {
                $.each(goodsInput, function (i, n) {
                    $(n).bind("keydown", function (event) {
                        if (event.keyCode == 13) {
                            $(goodsInput[i + 1]).focus();
                        }
                    });
                });
            }
        }

        //将成交单位代码解析成中文
        function parseUnitDataToChn(id) {
            while (id.length < 3) {
                id = "0" + id;
            }
            for (var i = 0; i < unitData.length; i++) {
                if (unitData[i].id == id) {
                    return unitData[i].name;
                }
            }
        }

        /**
         * 确定
         */
        function setGoodsMode() {
            var gmode = "";
            $(".goodsModeInput").each(function (index) {
                gmode += $(this).val() + "|";
            });
            gmode = gmode.substring(0, gmode.length - 1);
            var tgm = gmode.replace(/\|/g, "");

            // 		if($("#RECORD_ID").val() != "" && tgm == "") {
            // 			gmode = "";
            // 		}
            var glength = gmode.replace(/[^\x00-\xff]/g, "xx").length;
            if (glength > 255) {
                alert("商品规格当前长度为" + glength + "个字节，超过标准255个字节，请检查输入");
                return;
            } else {
                var b = "";
                var a = "";
                var p = 0;
                $("#goodsModeInputTB tr:lt(5)").each(function (i) {
                    $(this).find("td").each(function (j) {
                        if (j == 0) {
                            a = this.innerText
                        }
                        if (j == 1) {
                            b = $(this).find("input").val();
                        }
                    })
                    if (a.indexOf("其他") < 0) {
                        if (b == "") {
                            alert(a + "不能为空");
                            p++;
                            return false;
                        } else {
                            p = 0;
                            if (b == "是" || b == "否" || b == "无") {
                                alert("该要素栏不能只填:" + b + ",请重新填写!");
                                p++;
                                return false;
                            }
                        }
                    }
                });
                if (p == 0) {
                    $("#GOODS_MODE").val(gmode);
                    $("#COUNT").focus();
                    $("#COUNT").select();
                    $("#goodsModeInputTB").find("tr").remove();
                    $("#goodsModeInputTB").hide();
                    $($(".goodsModeInput")[0]).focus();
                    $($(".goodsModeInput")[0]).select();
                }

            }

// 	$("#goodsModeInputTB tr").each(function(i)) {}
// 	var length
// 	$("#goodsModeInputTB tr").each(function(i) {
// 		$(this).find("td").each(function(tdindex) {
// 			alert($(this).text());
// 		})
// 	});

        }

        /**
         * 取消
         */
        function cancel() {
            // 		$("#goodsModeInputTB").hide();
            $("#goodsModeInputTB").find("tr").remove();
            /* 	$("#CODE_T").val("");
             $("#CODE_S").val("");
             $("#UNIT").val("");
             $("#LEGAL_UNIT").val("");
             $("#SECOND_UNIT").val(""); */
        }

        /**
         *总价汇总
         */
        function refreshGoodsTotal() {
            var currency = "";
            var sum = 0;
            var sum_net_weight = 0;
            var sum_gross_weight = 0;
            var sum_goods_number = 0;
            var sum_total_money = 0;
            var sum_count = 0;
            $("#goods_list table").find("tr").each(function (index) {
                $(this).find("td").each(function (tdindex) {
                    var datasrc = this;
                    var data = datasrc.innerText;
                    switch (tdindex) {
                        case 6:
                            sum_count = data - (-sum_count);//计价数量
                            break;
                        case 7:
                            currency = data;
                            break;
                        case 8:
                            sum = data - (-sum);
                            break;
                        case 9:
                            sum_total_money = data - (-sum_total_money);
                            break;
                        case 15:
                            sum_goods_number = data - (-sum_goods_number);
                            break;
                        case 16:
                            sum_net_weight = data - (-sum_net_weight);
                            break;
                        case 17:
                            sum_gross_weight = data - (-sum_gross_weight);
                            break;
                    }
                });
            });
            $("#sum_net_weight").text(sum_net_weight.toFixed(5));//总净重
            $("#sum_gross_weight").text(sum_gross_weight.toFixed(5));//总毛重
            $("#sum_goods_number").text(sum_goods_number);//总件数
            //$("#sum_total_money").text(sum_total_money.toFixed(2));//总价
            $("#sum_total_money").text(sum_total_money);//总价
            $("#NET_WEIGHT").val(sum_net_weight.toFixed(5));
            $("#GROSS_WEIGHT").val(sum_gross_weight.toFixed(5));
            $("#GOODS_COUNT").val(sum_goods_number);
            $("#TOTAL_MONEY").val(sum_total_money.toFixed(2));
            //$("#SUM_COUNT").val(sum_count.toFixed(2));//总计价数量
            $("#SUM_COUNT").val(sum_count.toFixed(2));//总计价数量
        }

        /**
         * 计价单位、法定单位和第二单位之间的数量关系
         */
        $("#UNIT,#COUNT").bind("blur", function () {
            var COUNT = $("#COUNT").val();
            var UNIT = $("#UNIT").val();
            var LEGAL_UNIT = $("#LEGAL_UNIT").val();
            var SECOND_UNIT = $("#SECOND_UNIT").val();
            if (UNIT != "") {
                if (LEGAL_UNIT == UNIT) {
                    $("#LEGAL_COUNT").val(COUNT);
                }
                if (SECOND_UNIT == UNIT) {
                    $("#SECOND_COUNT").val(COUNT);
                }
                if (UNIT == "千克") {//如果计价单位为千克则计价数量和净重一样
                    $("#GOODS_NET_WEIGHT").val(COUNT);
                }
            }
        });

        /**
         * 关于法定单位为千克时，净重值的设置
         */
        $("#LEGAL_COUNT").bind("blur", function () {
            var LEGAL_UNIT = $("#LEGAL_UNIT").val();
            var LEGAL_COUNT = $("#LEGAL_COUNT").val();
            if (LEGAL_UNIT == "千克") {
                $("#GOODS_NET_WEIGHT").val(LEGAL_COUNT);
            }
        });

        /**
         * 关于第二单位为千克时，净重值的设置
         */
        $("#SECOND_COUNT").bind("blur", function () {
            var SECOND_UNIT = $("#SECOND_UNIT").val();
            var SECOND_COUNT = $("#SECOND_COUNT").val();
            if (SECOND_UNIT == "千克") {
                $("#GOODS_NET_WEIGHT").val(SECOND_COUNT);
            }
        });

        window.onresize = resetDIV;
        function resetDIV() {
            $("#goodsModeInputTB").css("left",
                                       (document.body.offsetWidth - parseInt(200)) / 2);
        }
        //上传分柜附件
        function uploadAccess() {
            var param = {
                id: '#dialog002'
            };
            jw.dialog(param);
        }
        //取消上传分柜附件
        function cancleUploadAccess() {
            var fileId = $("#containerInfoId").val();
            if (fileId) {
                $.ajax({
                           url: "attach-cancleFile?fileId=" + fileId
                                + "&businessType=D",
                           success: function (data) {
                               var msg = $.parseJSON(data.msg);
                               jw.alert(msg.msg);
                               if (msg.state == "1") {
                                   //$("#uploadForm").attr("enctype","multipart/form-data");
                                   $("#containerInfoId").val("");
                                   $("#containInfo table tr:eq(1) td:eq(0)").html("上传");
                               }
                           }
                       });
            } else {
                jw.alert("没有已上传文件！");
            }
        }

        /**
         * 毛重、净重关系，净重不能大于毛重
         */
        $("#GOODS_GROSS_WEIGHT").bind("blur", function () {
            var GOODS_GROSS_WEIGHT = $("#GOODS_GROSS_WEIGHT").val();
            var GOODS_NET_WEIGHT = $("#GOODS_NET_WEIGHT").val();
            if (parseInt(GOODS_NET_WEIGHT) > parseInt(GOODS_GROSS_WEIGHT)) {
                alert("净重不能大于毛重!");
                $("#GOODS_NET_WEIGHT").select();
            }
        });

        //直接单击第三步设置值和计算值
        $("#cc").live('click', function () {
            setValue();
            $("#orderSave").show();
            refreshGoodsTotal();
        });

        $("#CONTRACT_NO").live('change', function () {
            $("#INVOICE_NO").val($("#CONTRACT_NO").val());
        });

        var SIGNING_PLACE_VAL = $("#SIGNING_PLACE").val();
        if (SIGNING_PLACE_VAL == "") {
            $("#SIGNING_PLACE").val("佛山");
        }

        //其他货源地与备注的关系

        // var OTHER_GOODS_ADDR_VAL=$("#OTHER_GOODS_ADDR").val();
        // var OTHER_GOODS_ADDR_SHOW_VAL=$("#OTHER_GOODS_ADDR_SHOW").val();
        // $("#OTHER_GOODS_ADDR_SHOW").live('blur',function(){
        // 	var remark=$("#REMARK").val();
        // 	if(remark!=""){
        // 		remark += ",";
        // 	}
        // 	if(OTHER_GOODS_ADDR_VAL!=$("#OTHER_GOODS_ADDR").val()){
        // 		remark = remark.replace(OTHER_GOODS_ADDR_SHOW_VAL,"");
        // 		remark = remark.replace(",,",",");
        // 		$("#REMARK").val(remark+$("#OTHER_GOODS_ADDR_SHOW").val());
        // 	}
        // 	OTHER_GOODS_ADDR_VAL=$("#OTHER_GOODS_ADDR").val();
        // 	OTHER_GOODS_ADDR_SHOW_VAL=$("#OTHER_GOODS_ADDR_SHOW").val();
        // });

        $("#OTHER_GOODS_ADDR_SHOW").live(
                'blur',
                function () {
                    var OTHER_GOODS_ADDR_SHOW_VAL = $("#OTHER_GOODS_ADDR_SHOW")
                            .val();
                    if (OTHER_GOODS_ADDR_SHOW_VAL != "") {
                        if ($("#CONCRETE_GOODS_PACKAGE").val() != "") {
                            $("#REMARK").val($("#DECLARATION_PORT").val() + ",结汇,退税; 其他货源地："
                                             + OTHER_GOODS_ADDR_SHOW_VAL + "; 包装种类：" + $(
                                                     "#CONCRETE_GOODS_PACKAGE").val());
                        } else {
                            $("#REMARK").val($("#DECLARATION_PORT").val() + ",结汇,退税; 其他货源地："
                                             + OTHER_GOODS_ADDR_SHOW_VAL);
                        }
                    } else {
                        if ($("#CONCRETE_GOODS_PACKAGE").val() != "") {
                            $("#REMARK").val(
                                    $("#DECLARATION_PORT").val() + ",结汇,退税" + "; 包装种类：" + $(
                                            "#CONCRETE_GOODS_PACKAGE").val());
                        } else {
                            $("#REMARK").val($("#DECLARATION_PORT").val() + ",结汇,退税");
                        }
                    }
                });

        function doGetContainer() {
            var target = event.target;
            try {
                target.disabled = true;

                setTimeout(function () {
                    target.disabled = false;
                }, 7000);
            } catch (e) {
            }
            var container = $("#CONTAINER_NO_VAL").val();
            if (container == "") {
                alert("请输入柜号任一柜号进行查询!");
                $("#CONTAINER_NO").focus();
                return;
            } else {
                container = container.substring(0, 11);
            }
            // 		var work_type = $("#WORK_TYPE").val();
            // 		if(work_type == "进出闸口") {
            // 			work_type = "0";
            // 		} else {
            // 			work_type = "1";
            // 		}
            var iddata = "container_no=" + container + "&work_type=0";
            $
                    .ajax({
                              url: "declaration-getContainerInfoVal",
                              cache: false,
                              dataType: "json",
                              data: iddata,
                              success: function (data) {
                                  if (data.containerInfo != "[]") {
                                      var jdata = eval(data.containerInfo);
                                      var output = "";
                                      var cnUsed = false;
                                      var tmpwork_no = "";
                                      var tmptimes = "";
                                      var tmpio_type = "";
                                      var wn = "";
                                      var ct_count = "";
                                      for (var i = 0; i < jdata.length; i++) {
                                          var container = jdata[i].CONTAINER_NO;
                                          var ct_size = jdata[i].CT_SIZE;
                                          var pin = jdata[i].PIN;
                                          wn = jdata[i].WORK_NO;
                                          if (ct_size == "20") {
                                              ct_size = "S";
                                          } else {
                                              ct_size = "L";
                                          }
                                          if (wn != "" && wn != undefined) {
                                              cnUsed = true;
                                              tmpwork_no = jdata[i].WORK_NO.split(",");
                                              tmptimes = jdata[i].REG_DATE.split(",");
                                              tmpio_type = jdata[i].IO_TYPE.split(",");
                                          }
                                          if (pin > 1) {
                                              ct_count = pin + "拼";
                                              tmpwork_no = jdata[i].WORK_NO.split(",");
                                              tmptimes = jdata[i].REG_DATE.split(",");
                                              tmpio_type = jdata[i].IO_TYPE.split(",");
                                          } else {
                                              ct_count = "";
                                          }
                                          output +=
                                                  "<tr><td><input type='checkbox' value='"
                                                  + container + "' title='" + ct_size + "' /></td>";
                                          output += "<td>" + container + "</td>";
                                          output += "<td>" + ct_size + "</td>";
                                          output += "<td style='color: red;'>" + ct_count
                                                    + "</td>";
                                          output += "</tr>";
                                      }
                                      output += "<tr><td>共"
                                                + jdata.length
                                                + "只柜</td>"
                                                + "<td><a href='javascript:doSelectCN(0)'>确定</a></td>"
                                                + "<td><a href='javascript:doSelectCN(-1)'>取消</a></td>"
                                                + "</tr>";
                                      $("#cnListSelectTB").append(output);
                                      $("#cnListSelectTB").show();

                                      var msg = "请注意，当前柜号已经存在三联单资料\n相关流水号为：\n";
                                      for (var i = 0; i < tmpwork_no.length; i++) {
                                          msg += tmpwork_no[i] + "  日期：" + tmptimes[i]
                                                 + "  类型："
                                                 + (tmpio_type[i] == "E" ? "出口" : "进口")
                                                 + "\n";
                                      }
                                      if (cnUsed && $("#formType").val() != "2") {
                                          alert(msg);
                                      }
                                  } else {
                                      alert("暂时无柜号获取!");
                                  }
                              }
                          });
        }

        //全选柜号
        function selectAllCN() {
            $("#cnListSelectTB").find("input:checkbox").each(function () {
                if ($("#selectAllCN_1").attr("checked")) {
                    $(this).attr("checked", true);
                } else {
                    $(this).attr("checked", false);
                }
            });
        }

        function doSelectCN(flag) {
            if (flag == 0) {
                var fcn = "";
                var cnList = new Array();
                $("#guanbi").remove();
                $("#cnListTB").find("tr").each(function (index) {
                    if ($(this).attr("class") != "titleTR") {
                        cnList[index] = $(this).find("td")[1].innerText;
                    }
                });
                var exsitCnStr = "";
                var output = "";
                var containerJsonStr = "[";
                var containerInfo = "";
                $("#cnListSelectTB")
                        .find("input:checkbox")
                        .each(
                                function () {
                                    if ($(this).attr("id") != "selectAllCN_1"
                                        && $(this).attr("checked")) {
                                        var count = $("#cnListTB").find("tr")
                                                .size();
                                        var cn = $(this).val();
                                        fcn = cn;
                                        var CT_SIZE = $(this).attr("title");
                                        // check cn
                                        var cnExsit = false;
                                        for (var ci = 0; ci < cnList.length; ci++) {
                                            if (cn == cnList[ci]) {
                                                cnExsit = true;
                                            }
                                        }
                                        if (cnExsit) {
                                            if (exsitCnStr.indexOf(cn) == -1) {
                                                exsitCnStr += cn + " ";
                                            }
                                            containerJsonStr = containerJsonStr
                                                               + "{\"CONTAINER_NO\":\"" + cn
                                                               + "\",\"CT_SIZE\":\"" + CT_SIZE
                                                               + "\"},"
                                            containerInfo = containerInfo + cn
                                                            + ",";
                                        } else {
                                            cnList[cnList.length] = cn;
                                            output = "<tr>";
                                            output +=
                                                    "<td class='cn_data_count' style=\"width:35px;\">"
                                                    + count + "</td>";
                                            output += "<td class='cn_data' style=\"width:180px;\">"
                                                      + cn + "</td>";
                                            output += "<td class='cn_data' style=\"width:60px;\">"
                                                      + CT_SIZE + "</td>";
                                            // 						output += "<td class='cn_data hiddenValue' style=\"width:80px;\">"+$("#weight_input").val()+"</td>";
                                            // 						output += "<td class='hiddenValue'></td>";
                                            output += "</tr>";
                                            $("#cnListTB").append(output);
                                            $("#cn_input").val("");
                                            $("#specify_input").val("");
                                            $("#weight_input").val("");

                                            var test = $("#cnListTB").height()
                                                       - $("#cn_input_content")
                                                               .height() + 40;
                                            $("#cn_input_content").scrollTop(test);
                                            $("#cnListTB")
                                                    .find("tr")
                                                    .each(
                                                            function (index) {
                                                                if ($(this).attr(
                                                                                "class")
                                                                    != "titleTR") {
                                                                    $(this)
                                                                            .bind(
                                                                                    "click",
                                                                                    function () {
                                                                                        setTRClass(
                                                                                                "cnListTB",
                                                                                                index,
                                                                                                "selectTR");
                                                                                        $(
                                                                                                "#cn_edit_no")
                                                                                                .attr(
                                                                                                        "class",
                                                                                                        index);
                                                                                        $(
                                                                                                this)
                                                                                                .find(
                                                                                                        "td")
                                                                                                .each(
                                                                                                        function (j) {
                                                                                                            data =
                                                                                                                    $(
                                                                                                                            this)
                                                                                                                            .text();
                                                                                                            switch (j) {
                                                                                                                case 1:
                                                                                                                    $(
                                                                                                                            "#cn_input")
                                                                                                                            .val(
                                                                                                                                    data);
                                                                                                                    $(
                                                                                                                            "#cn_input")
                                                                                                                            .focus();
                                                                                                                    break;
                                                                                                                case 2:
                                                                                                                    $(
                                                                                                                            "#specify_input")
                                                                                                                            .val(
                                                                                                                                    data);
                                                                                                                    break;
                                                                                                                case 3:
                                                                                                                    $(
                                                                                                                            "#weight_input")
                                                                                                                            .val(
                                                                                                                                    data);
                                                                                                                    break;
                                                                                                                default:
                                                                                                                    break;
                                                                                                            }
                                                                                                        });
                                                                                    });
                                                                }
                                                            });
                                            containerJsonStr = containerJsonStr
                                                               + "{\"CONTAINER_NO\":\"" + cn
                                                               + "\",\"CT_SIZE\":\"" + CT_SIZE
                                                               + "\"},"
                                            containerInfo = containerInfo + cn
                                                            + ",";
                                        }
                                    }
                                });
                if (containerJsonStr == "[") {
                    containerJsonStr = "";
                } else {
                    containerJsonStr = containerJsonStr.substr(0,
                                                               containerJsonStr.length - 1);
                    containerJsonStr = containerJsonStr + "]";
                }
                if (containerInfo != "") {
                    containerInfo = containerInfo.substr(0,
                                                         containerInfo.length - 1);
                }
                var CONTAINER_NO_INFO_val = $("#CONTAINER_NO_INFO").val();
                var CONTAINER_NO_val = $("#CONTAINER_NO").val();
                if (CONTAINER_NO_INFO_val
                    && CONTAINER_NO_INFO_val != containerJsonStr) {
                    CONTAINER_NO_INFO_val = CONTAINER_NO_INFO_val.substring(1,
                                                                            CONTAINER_NO_INFO_val.length
                                                                            - 1);
                    containerJsonStr = containerJsonStr.substring(1,
                                                                  containerJsonStr.length - 1);
                    CONTAINER_NO_INFO_val = "[" + CONTAINER_NO_INFO_val + ","
                                            + containerJsonStr + "]";
                    $("#CONTAINER_NO_INFO").val(CONTAINER_NO_INFO_val);
                } else {
                    $("#CONTAINER_NO_INFO").val(containerJsonStr);
                }
                if (CONTAINER_NO_val && CONTAINER_NO_val != containerInfo) {
                    if (CONTAINER_NO_val.substring(CONTAINER_NO_val.length - 1) == ",") {
                        CONTAINER_NO_val = CONTAINER_NO_val.substring(0,
                                                                      CONTAINER_NO_val.length - 1);
                    }
                    $("#CONTAINER_NO").val(CONTAINER_NO_val + "," + containerInfo);
                } else {
                    $("#CONTAINER_NO").val(containerInfo);
                }
                //--20160930 修复$("#CONTAINER_NO").val重复柜号问题
                var nval = '';
                var nset = {};
                $("#CONTAINER_NO").val().split(',').map(function (cell) {
                    nset[cell] = '';
                });
                nval = Object.keys(nset).toString();
                $("#CONTAINER_NO").val(nval);

                var ninfoval = '';
                var ninfoset = {};
                var ninfoarray = [];
                JSON.parse(
                        $("#CONTAINER_NO_INFO").val() ? $("#CONTAINER_NO_INFO").val() : '[]').map(
                        function (cell) {
                            ninfoset[cell.CONTAINER_NO] = cell;
                        });
                for (var attr in  ninfoset) {
                    ninfoarray.push(ninfoset[attr]);
                }
                ninfoval = ninfoarray.length > 0 ? JSON.stringify(ninfoarray) : '';
                $("#CONTAINER_NO_INFO").val(ninfoval);
                //--end 20160930
                output =
                        "<tr id='guanbi' class='titleTR'><td colspan='3' align='center'><a href='javascript:doClose()'>关闭</a></td></tr>"
                $("#cnListTB").append(output);
                if (exsitCnStr != "") {
                    alert("重复的柜号有：" + exsitCnStr);
                }
                // 			getShipOwnerFromCN(fcn);
            }
            $("#cnListSelectTB").find("tr").each(function () {
                if ($(this).attr("class") != "titleTR") {
                    $(this).remove();
                }
            });
            $("#selectAllCN").attr("checked", false);
            $("#cnListSelectTB").hide();
            if (flag != -1) {
                $("#cnListTB").show();
            }
            $("#cn_input").focus();
            $("#cn_input").select();
            prop_bathOutputStr = "";
        }

        function clearAllCN() {
            var delNO = $("#cn_del_no").attr("title");
            clearInput("cn");
            $("#cnListTB").find("tr").each(function (index) {
                if ($(this).attr("class") != "titleTR") {
                    $(this).remove();
                    // 				var cid = $("#cnListTB").find("td")[1].innerText;
                    // 				if(cid != "") {
                    // 					delNO += cid + "_";
                    // 				}
                }
            });
            $("#cn_del_no").attr("title", delNO);
            $("#cnListTB").hide();
            $("#CONTAINER_NO").val("");
            $("#CONTAINER_NO_INFO").val("");
        }

        function clearInput(type) {
            if (type == "cn") {
                $("#cn_edit_no").attr("class", 0);
                $("#cn_input").val("");
                $("#specify_input").val("");
                $("#weight_input").val("");

                $("#cnListTB").find("tr").each(function (index) {
                    if ($(this).attr("class") != "titleTR") {
                        $(this).unbind("click");
                    }
                });

                $("#cnListTB").find("tr").each(function (index) {
                    if ($(this).attr("class") != "titleTR") {
                        $(this).bind("click", function () {
                            setTRClass("cnListTB", index, "selectTR");
                            $("#cn_edit_no").attr("class", index);
                            var data = $(".cn_data")[index - 1].innerText;
                            $("#cn_input").val(data);
                            $("#cn_input").focus();
                        });
                    }
                });
            }
        }

        function doGetContainerInfo() {
            $("#guanbi").remove();
            var output = "<tr id='guanbi' class='titleTR'><td colspan='3' align='center'><a href='javascript:doClose()'>关闭</a></td></tr>"
            $("#cnListTB").append(output);
            $("#cnListTB").show();
        }

        function doClose() {
            $("#cnListTB").hide();
        }

        window.onbeforeunload = function (e) {//##https:segmentfault.com/q/1010000000095813
            console.log(new Date() + 'onbeforeunload')
            $.ajax({
                       url: '../datalock/onUnlock?opaId=VDBS&bidId='
                            + $("#declareId").val(),
                       async: false
                   });
            return null;
        };
        window.onunload = function (e) {
            $.ajax({
                       url: '../datalock/onUnlock?opaId=VDBS&bidId='
                            + $("#declareId").val(),
                       async: false
                   });
        };
        $(function () {
            ajaxLoader.ajaxPost('../datalock/lock?opaId=VDBS&bidId='
                                + $("#declareId").val(), {}, function (data) {
                if (!data) {
                    jw.alert(data);
                }
                if ("200" == data.errcode) {

                } else {
                    // 				jw.alert(data.errmsg);
                }
            });
        });

        //黏贴获取柜号
        function doSelCtn(step) {
            switch (step) {
                case 0:
                {
                    $("#doSelCtnDiv").show();
                    break;
                }
                case 1:
                {
                    doAddBathCtn();
                    $("#doSelCtnDiv").hide();
                    break;
                }
                case 2:
                {
                    $("#doSelCtnDiv").hide();
                    break;
                }
                default:
                    break;
            }
        }
        var prop_bathOutputStr = "";
        function doAddBathCtn() {
            var ctns = $("#selCtns").val();
            var ctn_arr = new Array();
            ctn_arr = ctns.split("\n");
            var output = "";
            var jlength = 0;
            for (var i = 0; i < ctn_arr.length; i++) {
                // 			ctn_arr[i] = rplChar(rplChar(rplChar(rplChar(rplChar(ctn_arr[i],
                // 					"\r", ""), " ", ""), "\/", "\t"), ",", "\t"), ";", "\t");
                ctn_arr[i] = rplChar(rplChar(rplChar(rplChar(rplChar(ctn_arr[i],
                                                                     "\r", ""), " ", ""), ",",
                                                     "\t"), ";", "\t"), "\t", "");
            }
            if (ctn_arr.length > 0) {
                doGetOneCnInBath(ctn_arr, 0);
            }
        }

        function rplChar(str, c, d) {
            while (str.indexOf(c) > -1) {
                str = str.replace(c, d);
            }
            return str;
        }
    </script>
</head>
<body>
<!-- <form id="businessForm" action=""> -->
<div id="outer">
    <ul id="tab">
        <li id="aa" class="current">第一步，货物信息</li>
        <li id="bb">第二步，出口信息</li>
        <li id="cc">第三步，复核报关信息</li>
    </ul>
    <div class="clear"></div>
    <div id="content">
        <table>
            <tr>
                <td>
                    <input id="declareId" value="${declare.id }" type="hidden" name="id"/>
                    <%--     <input style="width: 150px;" type="text" id="declaration_sup_id" name="supCompany.name" value="${declare.supCompany.name}" /> --%>
                    <input id="EXPORT_PORT_CODE" type="hidden" name="export_port_code"
                           value="${declare.export_port_code }"/>
                    <input id="DECLARATION_PORT_CODE" type="hidden"
                           name="declaration_port_code"
                           value="${declare.declaration_port_code }"/>

                    <input id="SHENBAO_COMPANY_CO" type="hidden" name="shenbao_company_co"
                           value="${declare.shenbao_company_co }"/>
                    <input id="SHENBAO_COMPANY_NAME" type="hidden"
                           name="shenbao_company_name"
                           value="${declare.shenbao_company_name }"/>

                    <input type="hidden" id="modelTypeInfo" value="${param.modelType }"/>
                    <input type="hidden" id="isRecordInfo_val" value="${param.isRecord }"/>
                    <input type="hidden" id="isRecordInfo" name="is_record_info"
                           value="${declare.is_record_info }"/>
                    <input type="hidden" id="isRecordInfo_model"
                           value="${declareModel.is_record_info }"/>
                    <input type="hidden" id="stateVal" value="${declare.state }"/>
                    <input type="hidden" id="declaretion_type" name="customs_type"
                           value="${declare.customs_type}"/>
                    <input type="hidden" name="declaration_type" value="E"/>
                    <input type="hidden" name="tradeType" value="0"/>
                    <input type="hidden" id="CONTAINER_NO" name="container_no"
                           value='${declare.container_no }'>
                    <%--     <input type="text" id="contractTermsId" name="contractTerms.id" value="${declare.contractTerms.id }"> --%>
                    <%--     <input type="text" id="contractTermsType" name="contract_terms_type" value="${declare.contract_terms_type }"> --%>
                </td>
            </tr>
            <tr>
                <td>
                    <div style="float: left; margin: 0 5px;">
                        出口口岸：<input id="EXPORT_PORT" type="text"
                                    name="export_port" value="${declare.export_port }"/>
                        申报口岸：<input id="DECLARATION_PORT" type="text"
                                    name="declaration_port"
                                    value="${declare.declaration_port }"/>
                        报关行：<input style="width: 150px;" type="text" id="declaration_sup_id"
                                   name="supCompany.name"
                                   value="${declare.supCompany.name}"/>
                        <input type="hidden" id="declaration_sup" name="supCompany.id"
                               value="${declare.supCompany.id }"/>
                    </div>
                    <div id="showDeclarationFree" style="float: left; margin: 0 5px;">
                        <font color="red">
                            报关费：<label id="declarationFree"></label>元&nbsp;&nbsp;
                            <label id="containerNum_val">免报关费柜数：</label>
                            <label id="containerNum"></label>
                            <label id="offer_remark"></label>
                        </font>
                    </div>
                    <c:if test="${param.modelType eq '1'}">
                        <div id="SO_DIV" style="float: left;margin: 0 5px; display: none;">
                            SO：<input id="SO" name="so" value="${declareModel.so }"
                                      oninput="this.style.color='red'">
                        </div>
                        <div id="RECORD_ID_DIV" style="float: left;margin: 0 5px;">
                            手册号：<input id="RECORD_ID" name="record_id"
                                       value="${declareModel.record_id }"
                                       maxlength="12" oninput="this.style.color='red'"><font
                                color="red">*</font>
                        </div>
                    </c:if>
                    <c:if test="${empty param.modelType || param.modelType eq '0'}">
                        <div id="SO_DIV" style="float: left;margin: 0 5px; display: none;">
                            SO：<input id="SO" name="so" value="${declare.so }">
                        </div>
                        <div id="RECORD_ID_DIV" style="float: left;margin: 0 5px;">
                            手册号：<input id="RECORD_ID" name="record_id"
                                       value="${declare.record_id }"
                                       maxlength="12"><font color="red">*</font>
                        </div>
                    </c:if>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;柜号：<input id="CONTAINER_NO_VAL"><font color="red">(此处填写任一柜号获取)</font>
                    <input id="getContainer" type="button" value="获取柜号"
                           onclick="doGetContainer();"/>
                    <input id="getContainerInfo" type="button" value="查看详细柜号信息"
                           onclick="doGetContainerInfo();"/>
                    <input id="pastContainer" type="button" value="黏贴柜号" onclick="doSelCtn(0);"/>
                    <input id="CONTAINER_NO_INFO" style="display: none;"
                           name="container_no_show"
                           value='${declare.container_no_show }'/>
                    <table id="cnListSelectTB" rules="rows" class="dataTB">
                        <tr class="titleTR">
                            <td><input type="checkbox" id="selectAllCN_1"
                                       onclick="selectAllCN();"
                                       style="width: auto; margin-left: 5px;"/><label
                                    id="label_selectAllCN" for="selectAllCN_1">全选</label></td>
                            <td>柜号</td>
                            <td>规格</td>
                        </tr>
                    </table>

                    <div id="doSelCtnDiv">
                        <table>
                            <tr>
                                <td><font color="red">新港码头出口的柜黏贴格式为：柜号<br> 例如：GESU5211079</font>
                                </td>
                            </tr>
                            <tr>
                                <td><font color="red">非新港码头出口的柜黏贴格式为：柜号/柜尺
                                    <br>例如：GESU5211079/20</font></td>
                            </tr>
                            <tr>
                                <td><textarea rows="15" cols="25" id="selCtns"></textarea></td>
                            </tr>
                            <tr>
                                <td>
                                    <a href="javascript:doSelCtn(1)">确定</a>
                                    <a href="javascript:doSelCtn(2)">关闭</a>
                                </td>
                            </tr>
                        </table>
                    </div>

                    <div id="cn_input_content"></div>
                    <div id="cn_edit_no" style="display: hidden;" class="0"></div>
                    <div id="cn_del_no" style="display: hidden;" title=""></div>
                    <table rules="rows" id="cnListTB" class="dataTB">
                        <tr class="titleTR">
                            <td class="titleTD" style="width: 35px;">序号</td>
                            <td class="titleTD" style="width: 180px;">柜号<span
                                    id="clearAllCNSpan" style="margin-left: 30px;"><a
                                    href="javascript:clearAllCN();">全部清除</a></span></td>
                            <td class="titleTD" style="width: 60px;">规格</td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <!-- 第一步 -->
        <ul style="display:block;">
            <li>
                <!-- 货物信息输入 -->
                <div id="goods_input">
                    <h3 class="list_title">填写每一项商品的货物信息：</h3>
                    <c:if test="${param.modelType eq '1'}">
                        <table style="width: 100%;">
                            <tr>
                                <td style="display: none;">序号</td>
                                <td style="display: none;">
                                    <input id="INDEX" type="hidden" value=""
                                           oninput="this.style.color='red'">
                                </td>
                                <td id="handBookItemNoTile" class="table_list_name">手册项号：</td>
                                <td id="handBookItemNoValue">
                                    <input id="HANDBOOK_ITEM_NO" value="" param.modelType=='1'
                                           oninput="this.style.color='red'">
                                    <font color="red">*</font></td>
                                <td id="versionNoTitle" class="table_list_name">版本号：</td>
                                <td id="versionNoValue"><input id="VERSION_NO" value=""
                                                               oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name" style="display: none;">柜号：</td>
                                <td><input id="CONTAINER_NO" value="" style="display: none;"
                                           oninput="this.style.color='red'"></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">商品名称：</td>
                                <td><input type="text" id="NAME" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">规格型号：</td>
                                <td><input id="KEY_ELEMENTS" value=""
                                           onmouseover="this.title=this.value"
                                           oninput="this.style.color='red'"/></td>
                                <td id="goodsModeTitle" class="table_list_name">要素：</td>
                                <td id="goodsModeValue"><input id="GOODS_MODE" value=""
                                                               oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <!--         					<td class="table_list_name">规格型号：</td> -->
                                <!--         					<td><input id="GOODS_MODE" value=""></td> -->
                            </tr>
                            <tr>
                                <td class="table_list_name">税号：</td>
                                <td><input id="CODE_T" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">税号附号：</td>
                                <td><input id="CODE_S" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">计价数量：</td>
                                <td><input id="COUNT" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">计价单位：</td>
                                <td><input id="UNIT" value="" oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">单价：</td>
                                <td><input id="UNIT_PRICE" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">总价：</td>
                                <td><input id="TOTAL_PRICE" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                </td>
                                <td class="table_list_name">币制：</td>
                                <td><input id="CURRENCY" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                            </tr>
                            <tr id="legalCountAndUnit">
                                <td class="table_list_name">法定数量：</td>
                                <td><input id="LEGAL_COUNT" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                </td>
                                <td class="table_list_name">法定单位：</td>
                                <td><input id="LEGAL_UNIT" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr id="secondCountAndUnit">
                                <td class="table_list_name">第二数量：</td>
                                <td><input id="SECOND_COUNT" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">第二计量单位：</td>
                                <td><input id="SECOND_UNIT" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">件数(箱数)：</td>
                                <td><input id="GOODS_NUMBER" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">包装种类：</td>
                                <td><input id="PACKAGE_TYPE" placeholder="请填写具体包装种类" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">净重：</td>
                                <td><input id="GOODS_NET_WEIGHT" value=""
                                           oninput="this.style.color='red'">KG<font
                                        color="red">*</font></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">毛重：</td>
                                <td><input id="GOODS_GROSS_WEIGHT" value=""
                                           oninput="this.style.color='red'">KG<font
                                        color="red">*</font></td>
                                <!-- 	        					<td class="table_list_name">目的地：</td> -->
                                <td class="table_list_name">最终目的国(地区)：</td>
                                <td>
                                    <input id="DESTINATION"
                                           value="${declare.commodities[0].destination }"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                </td>
                                <td class="table_list_name">征免：</td>
                                <td><input id="GOODS_LEVYMODE" value=""
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">原产国(地区)：</td>
                                <td>
                                    <input id="ORIGIN_COUNTRY"
                                           value="${declare.commodities[0].origin_country }"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                    <input id="ORIGIN_COUNTRY_CODE" type="hidden"
                                           value="${declare.commodities[0].origin_country_code }">
                                </td>
                            </tr>
                            <tr>
                                <td class="table_list_name">装箱单备注：</td>
                                <td colspan="5">
                                    <!--         						<textarea rows="5" cols="30%"></textarea> -->
                                    <input id="PACKINGLIST_REMARK" style="width: 83%" value=""
                                           oninput="this.style.color='red'">
                                </td>
                            </tr>
                            <tr>
                                <td style="display: none;"><input id="ID" type="hidden" value=""
                                                                  oninput="this.style.color='red'">
                                </td>
                                <td colspan="3" align="right"><input type="button" value="确认货物"
                                                                     onclick="confirmDeclare();">
                                </td>
                                <td colspan="3" align="left"><input type="button" value="取消"
                                                                    onclick="cancelDeclare();">
                                </td>
                            </tr>
                        </table>
                    </c:if>
                    <c:if test="${param.modelType ne '1'}">
                        <table style="width: 100%;">
                            <tr>
                                <td style="display: none;">序号</td>
                                <td style="display: none;"><input id="INDEX" type="hidden" value="">
                                </td>
                                <td id="handBookItemNoTile" class="table_list_name">手册项号：</td>
                                <td id="handBookItemNoValue"><input id="HANDBOOK_ITEM_NO" value="">
                                </td>
                                <td id="versionNoTitle" class="table_list_name">版本号：</td>
                                <td id="versionNoValue"><input id="VERSION_NO" value=""></td>
                                <td class="table_list_name" style="display: none;">柜号：</td>
                                <td><input id="CONTAINER_NO" value="" style="display: none;"></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">商品名称：</td>
                                <td><input type="text" id="NAME" value=""><font color="red">*</font>
                                </td>
                                <td class="table_list_name">规格型号：</td>
                                <td><input id="KEY_ELEMENTS" value=""
                                           onmouseover="this.title=this.value"/></td>
                                <td id="goodsModeTitle" class="table_list_name">要素：</td>
                                <td id="goodsModeValue"><input id="GOODS_MODE" value=""><font
                                        color="red">*</font></td>
                                <!--         					<td class="table_list_name">规格型号：</td> -->
                                <!--         					<td><input id="GOODS_MODE" value=""></td> -->
                            </tr>
                            <tr>
                                <td class="table_list_name">税号：</td>
                                <td><input id="CODE_T" value=""><font color="red">*</font></td>
                                <td class="table_list_name">税号附号：</td>
                                <td><input id="CODE_S" value=""><font color="red">*</font></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">计价数量：</td>
                                <td><input id="COUNT" value=""><font color="red">*</font></td>
                                <td class="table_list_name">计价单位：</td>
                                <td><input id="UNIT" value=""><font color="red">*</font></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">单价：</td>
                                <td><input id="UNIT_PRICE" value=""><font color="red">*</font></td>
                                <td class="table_list_name">总价：</td>
                                <td><input id="TOTAL_PRICE" value=""><font color="red">*</font></td>
                                <td class="table_list_name">币制：</td>
                                <td><input id="CURRENCY" value=""><font color="red">*</font></td>
                            </tr>
                            <tr id="legalCountAndUnit">
                                <td class="table_list_name">法定数量：</td>
                                <td><input id="LEGAL_COUNT" value=""><font color="red">*</font></td>
                                <td class="table_list_name">法定单位：</td>
                                <td><input id="LEGAL_UNIT" value=""><font color="red">*</font></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr id="secondCountAndUnit">
                                <td class="table_list_name">第二数量：</td>
                                <td><input id="SECOND_COUNT" value=""><font color="red">*</font>
                                </td>
                                <td class="table_list_name">第二计量单位：</td>
                                <td><input id="SECOND_UNIT" value=""><font color="red">*</font></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">件数(箱数)：</td>
                                <td><input id="GOODS_NUMBER" value=""><font color="red">*</font>
                                </td>
                                <td class="table_list_name">包装种类：</td>
                                <td><input id="PACKAGE_TYPE" placeholder="请填写具体包装种类" value=""><font
                                        color="red">*</font>
                                </td>
                                <td class="table_list_name">净重：</td>
                                <td><input id="GOODS_NET_WEIGHT" value="">KG<font
                                        color="red">*</font></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">毛重：</td>
                                <td><input id="GOODS_GROSS_WEIGHT" value="">KG<font
                                        color="red">*</font></td>
                                <!-- 	        					<td class="table_list_name">目的地：</td> -->
                                <td class="table_list_name">最终目的国(地区)：</td>
                                <td>
                                    <input id="DESTINATION"
                                           value="${declare.commodities[0].destination }"><font
                                        color="red">*</font>
                                    <input id="DESTINATION_CODE" type="hidden"
                                           value="${declare.commodities[0].destination }">
                                </td>
                                <td class="table_list_name">征免：</td>
                                <td><input id="GOODS_LEVYMODE" value=""><font color="red">*</font>
                                </td>
                            </tr>
                            <tr>
                                <td class="table_list_name">原产国(地区)：</td>
                                <td>
                                    <input id="ORIGIN_COUNTRY"
                                           value="${declare.commodities[0].origin_country }"><font
                                        color="red">*</font>
                                    <input id="ORIGIN_COUNTRY_CODE" type="hidden"
                                           value="${declare.commodities[0].origin_country_code }">
                                </td>
                            </tr>

                            <tr>
                                <td class="table_list_name">装箱单备注：</td>
                                <td colspan="5">
                                    <!--         						<textarea rows="5" cols="30%"></textarea> -->
                                    <input id="PACKINGLIST_REMARK" style="width: 83%" value="">
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6"><font color="red">说明：有标记红色*号为必填项!</font></td>
                            </tr>
                            <tr>
                                <td style="display: none;"><input id="ID" type="hidden" value="">
                                </td>
                                <td colspan="3" align="right"><input type="button" value="确认货物"
                                                                     onclick="confirmDeclare();">
                                </td>
                                <td colspan="3" align="left"><input type="button" value="取消"
                                                                    onclick="cancelDeclare();">
                                </td>
                            </tr>

                        </table>
                    </c:if>
                    <table id="goodsModeInputTB" rules="rows" class="dataTB"></table>
                </div>
                <!-- 货物列表 -->
                <div id="goods_list" style="display: none;">
                    <h3 class="list_title">货物信息表：</h3>
                    <table class="table-border" style="width:100%;border:#000">
                        <tr>
                            <!--         					<th lang="INDEX" class="table_th">序号</th> -->
                            <!--         					<th lang="CODE_T" class="table_th">商品编号</th> -->
                            <!--         					<th class="table_th">备案序号</th> -->
                            <!--         					<th lang="NAME" class="table_th">商品名称</th> -->
                            <!--         					<th lang="GOODS_MODE" class="table_th">规格</th> -->
                            <!--         					<th lang="DESTINATION" class="table_th">目的地</th> -->
                            <!--         					<th lang="COUNT" class="table_th">数量</th> -->
                            <!--         					<th lang="UNIT" class="table_th">单位</th> -->
                            <!--         					<th lang="CURRENCY" class="table_th">币制</th> -->
                            <!--         					<th lang="TOTAL_PRICE" class="table_th">总价</th> -->
                            <!--         					<th lang="OPERATION" class="table_th">操作</th> -->

                            <!--         					<th lang="HANDBOOK_ITEM_NO" style="display: none;">手册项号</th> -->
                            <!--         					<th lang="CODE_S" style="display: none;">税号附号</th> -->
                            <!--         					<th lang="UNIT_PRICE" style="display: none;">单价</th> -->
                            <!--         					<th lang="LEGAL_COUNT" style="display: none;">法定数量</th> -->
                            <!--         					<th lang="LEGAL_UNIT" style="display: none;">法定单位</th> -->
                            <!--         					<th lang="GOODS_NUMBER" style="display: none;">件数</th> -->
                            <!--         					<th lang="GOODS_NET_WEIGHT" style="display: none;">净重</th> -->
                            <!--         					<th lang="GOODS_GROSS_WEIGHT" style="display: none;">毛重</th> -->
                            <!--         					<th lang="SECOND_COUNT" style="display: none;">第二数量</th> -->
                            <!--         					<th lang="SECOND_UNIT" style="display: none;">第二计量单位</th> -->
                            <!--         					<th lang="LEVYMODE" style="display: none;">征免</th> -->
                            <th lang="index_num" class="table_th">序号</th>
                            <th lang="handbook_item_no">手册项号</th>
                            <th lang="code_t" class="table_th">商品编号</th>
                            <!-- <th class="table_th">备案序号</th> -->
                            <th lang="name" class="table_th">商品名称</th>
                            <th lang="key_elements" class="table_th">规格</th>
                            <th lang="destination" class="table_th">最终目的国(地区)</th>
                            <th lang="count" class="table_th">数量</th>
                            <th lang="unit" class="table_th">单位</th>
                            <th lang="currency" class="table_th">币制</th>
                            <th lang="total_price" class="table_th">总价</th>
                            <th lang="operation" class="table_th">操作</th>

                            <th lang="code_s" style="display: none;">税号附号</th>
                            <th lang="unit_price" style="display: none;">单价</th>
                            <th lang="legal_count" style="display: none;">法定数量</th>
                            <th lang="legal_unit" style="display: none;">法定单位</th>
                            <th lang="goods_number" style="display: none;">件数</th>
                            <th lang="goods_net_weight" style="display: none;">净重</th>
                            <th lang="goods_gross_weight" style="display: none;">毛重</th>
                            <th lang="second_count" style="display: none;">第二数量</th>
                            <th lang="second_unit" style="display: none;">第二计量单位</th>
                            <th lang="levymode" style="display: none;">征免</th>
                            <th lang="id" style="display: none;">id</th>
                            <th lang="container_no" style="display: none;">柜号</th>
                            <th lang="version_no" style="display: none;">版本号</th>
                            <th lang="goods_mode" style="display: none;">要素</th>
                            <th lang="packinglist_remark" style="display: none;">装箱单备注</th>
                            <th lang="package_type" style="display: none;">具体包装种类</th>
                            <th lang="destination_code" style="display: none;">目的地代码</th>
                            <th lang="origin_country" class="table_th" style="display: none;">原产国
                            </th>
                            <th lang="origin_country_code" style="display: none;">原产国代码</th>
                        </tr>
                        <c:if test="${param.modelType eq '1'}">
                            <c:forEach var="de" items="${declareModel.commodities}" varStatus="st">
                                <tr>
                                    <td name="INDEX">${st.index+1}</td>
                                    <td name="HANDBOOK_ITEM_NO"
                                        lang="handbook_item_no">${de.handbook_item_no}</td>
                                    <td name="CODE_T" lang="code_t">${de.code_t}</td>
                                    <td name="NAME" lang="name">${de.name}</td>
                                    <td name="KEY_ELEMENTS"
                                        lang="key_elements">${de.key_elements}</td>
                                    <td name="DESTINATION" lang="destination">${de.destination}</td>
                                    <td name="COUNT" lang="count">${de.count}</td>
                                    <td name="UNIT" lang="unit">${de.unit}</td>
                                    <td name="CURRENCY" lang="currency">${de.currency}</td>
                                    <td name="TOTAL_PRICE" lang="total_price">${de.total_price}</td>
                                    <td name="OPERATION" lang="operation">
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;' onclick='javascript:addGoods(this);'>增加</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;' onclick='javascript:modGoods(this);'>修改</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;' onclick='javascript:delGoods(this);'>删除</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;'
                                           onclick='javascript:copyGoods(this);'>复制</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;' onclick='javascript:upGoods(this);'>上移</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;'
                                           onclick='javascript:downGoods(this);'>下移</a>
                                    </td>
                                    <td name="CODE_S" lang="code_s"
                                        style="display: none;">${de.code_s}</td>
                                    <td name="UNIT_PRICE" lang="unit_price"
                                        style="display: none;">${de.unit_price}</td>
                                    <td name="LEGAL_COUNT" lang="legal_count"
                                        style="display: none;">${de.legal_count}</td>
                                    <td name="LEGAL_UNIT" lang="legal_unit"
                                        style="display: none;">${de.legal_unit}</td>
                                    <td name="GOODS_NUMBER" lang="goods_number"
                                        style="display: none;">${de.goods_number}</td>
                                    <td name="GOODS_NET_WEIGHT" lang="goods_net_weight"
                                        style="display: none;">${de.goods_net_weight}</td>
                                    <td name="GOODS_GROSS_WEIGHT" lang="goods_gross_weight"
                                        style="display: none;">${de.goods_gross_weight}</td>
                                    <td name="SECOND_COUNT" lang="second_count"
                                        style="display: none;">${de.second_count}</td>
                                    <td name="SECOND_UNIT" lang="second_unit"
                                        style="display: none;">${de.second_unit}</td>
                                    <td name="LEVYMODE" lang="levymode"
                                        style="display: none;">${de.levymode}</td>
                                    <td name="ID" lang="id" style="display: none;"></td>
                                    <td name="CONTAINER_NO" lang="container_no"
                                        style="display: none;">${de.container_no}</td>
                                    <td name="VERSION_NO" lang="version_no"
                                        style="display: none;">${de.version_no}</td>
                                    <td name="GOODS_MODE" lang="goods_mode"
                                        style="display: none;">${de.goods_mode}</td>
                                    <td name="PACKINGLIST_REMARK" lang="packinglist_remark"
                                        style="display: none;">${de.packinglist_remark}</td>
                                    <td name="PACKAGE_TYPE" lang="package_type"
                                        style="display: none;">${de.package_type}</td>
                                    <td name="DESTINATION_CODE" lang="destination_code"
                                        style="display: none;">${de.destination_code}</td>
                                    <td name="ORIGIN_COUNTRY" lang="origin_country"
                                        style="display: none;">${de.origin_country}</td>
                                    <td name="ORIGIN_COUNTRY_CODE" lang="origin_country_code"
                                        style="display: none;">${de.origin_country_code}</td>
                                </tr>
                            </c:forEach>
                        </c:if>
                        <c:if test="${param.modelType ne '0'}">
                            <c:forEach var="de" items="${declare.commodities}" varStatus="st">
                                <tr>
                                    <td name="INDEX">${de.index_num}</td>
                                    <td name="HANDBOOK_ITEM_NO"
                                        lang="handbook_item_no">${de.handbook_item_no}</td>
                                    <td name="CODE_T" lang="code_t">${de.code_t}</td>
                                    <td name="NAME" lang="name">${de.name}</td>
                                    <td name="KEY_ELEMENTS"
                                        lang="key_elements">${de.key_elements}</td>
                                    <td name="DESTINATION" lang="destination">${de.destination}</td>
                                    <td name="COUNT" lang="count">${de.count}</td>
                                    <td name="UNIT" lang="unit">${de.unit}</td>
                                    <td name="CURRENCY" lang="currency">${de.currency}</td>
                                    <td name="TOTAL_PRICE" lang="total_price">${de.total_price}</td>
                                    <td name="OPERATION" lang="operation">
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;' onclick='javascript:addGoods(this);'>增加</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;' onclick='javascript:modGoods(this);'>修改</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;' onclick='javascript:delGoods(this);'>删除</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;'
                                           onclick='javascript:copyGoods(this);'>复制</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;' onclick='javascript:upGoods(this);'>上移</a>
                                        <a class="ui-button ui-widget ui-state-default ui-corner-all"
                                           href='javascript:;'
                                           onclick='javascript:downGoods(this);'>下移</a>
                                    </td>
                                    <td name="CODE_S" lang="code_s"
                                        style="display: none;">${de.code_s}</td>
                                    <td name="UNIT_PRICE" lang="unit_price"
                                        style="display: none;">${de.unit_price}</td>
                                    <td name="LEGAL_COUNT" lang="legal_count"
                                        style="display: none;">${de.legal_count}</td>
                                    <td name="LEGAL_UNIT" lang="legal_unit"
                                        style="display: none;">${de.legal_unit}</td>
                                    <td name="GOODS_NUMBER" lang="goods_number"
                                        style="display: none;">${de.goods_number}</td>
                                    <td name="GOODS_NET_WEIGHT" lang="goods_net_weight"
                                        style="display: none;">${de.goods_net_weight}</td>
                                    <td name="GOODS_GROSS_WEIGHT" lang="goods_gross_weight"
                                        style="display: none;">${de.goods_gross_weight}</td>
                                    <td name="SECOND_COUNT" lang="second_count"
                                        style="display: none;">${de.second_count}</td>
                                    <td name="SECOND_UNIT" lang="second_unit"
                                        style="display: none;">${de.second_unit}</td>
                                    <td name="LEVYMODE" lang="levymode"
                                        style="display: none;">${de.levymode}</td>
                                    <td name="ID" lang="id" style="display: none;">${de.id}</td>
                                    <td name="CONTAINER_NO" lang="container_no"
                                        style="display: none;">${de.container_no}</td>
                                    <td name="VERSION_NO" lang="version_no"
                                        style="display: none;">${de.version_no}</td>
                                    <td name="GOODS_MODE" lang="goods_mode"
                                        style="display: none;">${de.goods_mode}</td>
                                    <td name="PACKINGLIST_REMARK" lang="packinglist_remark"
                                        style="display: none;">${de.packinglist_remark}</td>
                                    <td name="PACKAGE_TYPE" lang="package_type"
                                        style="display: none;">${de.package_type}</td>
                                    <td name="DESTINATION_CODE" lang="destination_code"
                                        style="display: none;">${de.destination_code}</td>
                                    <td name="ORIGIN_COUNTRY" lang="origin_country"
                                        style="display: none;">${de.origin_country}</td>
                                    <td name="ORIGIN_COUNTRY_CODE" lang="origin_country_code"
                                        style="display: none;">${de.origin_country_code}</td>
                                </tr>
                            </c:forEach>
                        </c:if>

                    </table>
                    <div align="center" style="width: 100%;margin-top: 5px;"><input type="button"
                                                                                    value="下一步"
                                                                                    onclick="gotoTab();">
                    </div>
                </div>
                <div id="input_declare_goods"></div>
            </li>
        </ul>
        <!-- 第二步 -->
        <c:if test="${param.modelType eq '1'}">
            <input id="actionChain" value="${declareModel.actionChain}" type="hidden"
                   name="actionChain"/>
            <ul>
                <li>
                    <div>
                        <h3 class="list_title">请填写出口信息：</h3>
                        <table style="width: 100%;">
                            <tr>
                                <td class="table_list_name">卖方：</td>
                                <td><input id="SELLER" name="seller"
                                           value="${declareModel.seller}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">地址：</td>
                                <td><input id="SELLER_ADDRESS" name="seller_address"
                                           value="${declareModel.seller_address}"
                                           oninput="this.style.color='red'"></td>
                                <td class="table_list_name">电话：</td>
                                <td><input id="SELLER_PHONE" name="seller_phone"
                                           value="${declareModel.seller_phone}"
                                           oninput="this.style.color='red'"></td>
                                <td class="table_list_name">传真：</td>
                                <td><input id="SELLER_FAX" name="seller_fax"
                                           value="${declareModel.seller_fax}"
                                           oninput="this.style.color='red'"></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">买方：</td>
                                <td><input id="BUYER" name="buyer"
                                           value="${declareModel.buyer}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">境内货源地：</td>
                                <td>
                                    <input id="GOODS_ADDR_SHOW" name="goods_addr"
                                           value="${declareModel.goods_addr}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                    <input id="GOODS_ADDR" name="goods_addr_code"
                                           value="${declareModel.goods_addr_code}" type="hidden">
                                </td>

                                <td class="table_list_name">其他货源地：</td>
                                <td>
                                    <input id="OTHER_GOODS_ADDR_SHOW"
                                           name="other_goods_addr"
                                           value="${declareModel.other_goods_addr}"
                                           oninput="this.style.color='red'">
                                    <input id="OTHER_GOODS_ADDR"
                                           value="${declareModel.other_goods_addr}" type="hidden">
                                </td>

                                <!-- 					<td class="table_list_name">发货单位：</td> -->
                                <td class="table_list_name">生产销售单位：</td>
                                <td>
                                    <input id="FAHUO_COMPANY_NAME" name="fahuo_company_name"
                                           value="${declareModel.fahuo_company_name}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                    <input id="FAHUO_COMPANY_CO" type="hidden"
                                           name="fahuo_company_co"
                                           value="${declareModel.fahuo_company_co}">
                                    <input id="COMPANY_NAME" type="hidden"
                                           name="company_name"
                                           value="${declareModel.company_name}">
                                    <input id="COMPANY_CO" type="hidden" name="company_co"
                                           value="${declareModel.company_co}">
                                </td>
                            </tr>
                            <tr>
                                <td class="table_list_name">签约日期：</td>
                                    <%-- 					<td><input id="EXPORT_DATE" name="export_date" value="${declareModel.export_date}"></td> --%>
                                <td>
                                    <input id="CONTRACT_DATE" name="contract_date"
                                           value='<fmt:formatDate value="${declareModel.contract_date}" pattern="yyyy-MM-dd" />'
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                </td>
                                <td class="table_list_name">合同协议号：</td>
                                <td><input id="CONTRACT_NO" name="contract_no"
                                           value="${declareModel.contract_no}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">发票号：</td>
                                <td><input id="INVOICE_NO" name="invoice_no"
                                           value="${declareModel.invoice_no}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">许可证号：</td>
                                <td><input id="LICENSE_NO" name="license_no"
                                           value="${declareModel.license_no}"
                                           oninput="this.style.color='red'"></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">征免性质：</td>
                                <td>
                                    <input id="LEVYMODE_SHOW" name="levymode"
                                           value="${declareModel.levymode}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                    <input id="LEVYMODE" type="hidden" name="levymode_code"
                                           value="${declareModel.levymode_code}">
                                </td>
                                <td class="table_list_name">包装种类：</td>
                                <td>
                                    <input id="GOODS_PACKAGE" name="goods_package"
                                           value="${declareModel.goods_package}"
                                           oninput="this.style.color='red'">
                                    <input id="CONCRETE_GOODS_PACKAGE"
                                           style="width: 50px; display: none;"
                                           placeholder="具体包装种类"
                                           name="concrete_goods_package"
                                           value="${declareModel.concrete_goods_package }"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                </td>
                                <td class="table_list_name">
                                    <input type="radio" id="noWoodPackaging"
                                           name="is_wood_packaging" value="1">
                                </td>
                                <td>无木质包装声明</td>
                                <td class="table_list_name">
                                    <input type="radio" id="woodPackaging"
                                           name="is_wood_packaging" value="2">
                                </td>
                                <td>木质包装声明+合格证</td>
                                <!-- 					<td colspan="2"></td> -->

                            </tr>
                            <tr>
                                <td class="table_list_name">箱唛：</td>
                                <td>
                                    <input id="CARTON" name="carton"
                                           value="${declareModel.carton}"
                                           oninput="this.style.color='red'">
                                    <input id="GOODS_COUNT" type="hidden" name="goods_count"
                                           value="${declareModel.goods_count}">
                                    <input id="GROSS_WEIGHT" type="hidden"
                                           name="gross_weight"
                                           value="${declareModel.gross_weight}">
                                    <input id="NET_WEIGHT" type="hidden" name="net_weight"
                                           value="${declareModel.net_weight}">
                                    <input id="TOTAL_MONEY" type="hidden" name="total_money"
                                           value="${declareModel.total_money}"/>
                                    <input id="SUM_COUNT" type="hidden" name="sum_count"
                                           value="${declareModel.sum_count}"/>
                                    <!-- 						运抵国 -->
                                    <input id="ARRIVED_COUNTRY_SHOW" type="hidden"
                                           value="${declareModel.arrived_country}">
                                    <!-- 						指运港 -->
                                    <input id="ARRIVED_PORT_SHOW" type="hidden"
                                           value="${declareModel.arrived_port}">
                                </td>
                                <td class="table_list_name">监管方式：</td>
                                <td>
                                    <input id="TRADE_MODE_SHOW" name="trade_mode"
                                           value="${declareModel.trade_mode}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                    <input id="TRADE_MODE" type="hidden"
                                           name="trade_mode_code"
                                           value="${declareModel.trade_mode_code}">
                                </td>
                                <td class="table_list_name">运输方式：</td>
                                <td>
                                    <input id="TRANSPORT_MODE" name="transport_mode"
                                           value="${declareModel.transport_mode}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                    <input name="transport_mode_code" type="hidden"
                                           value="${declareModel.transport_mode_code}"/>
                                </td>
                                <td class="table_list_name">结汇方式：</td>
                                <td>
                                    <input id="LC_TYPE_SHOW" name="lc_type"
                                           value="${declareModel.lc_type}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                    <input id="LC_TYPE" type="hidden"
                                           value="${declareModel.lc_type}">
                                </td>

                                <td colspan="2"></td>
                                <!-- <td colspan="4" align="center"><input type="checkbox" >无木质包装声明</td>
					<td colspan="4" align="center"><input type="checkbox" >木质包装声明+合格证</td> -->
                            </tr>
                            <tr lang="FREIGHT_TR">
                                <td class="table_list_name">运费：</td>
                                <td colspan="7">
                                    <input id="FREIGHT1" name="freight1"
                                           value="${declareModel.freight1}"
                                           placeholder="--计算类型--" oninput="this.style.color='red'">
                                    <input id="FREIGHT2" name="freight2"
                                           value="${declareModel.freight2}"
                                           placeholder="--数量--" oninput="this.style.color='red'">
                                    <input id="FREIGHT3_SHOW" name="freight3"
                                           value="${declareModel.freight3}"
                                           placeholder="--币制--" oninput="this.style.color='red'">
                                    <input id="FREIGHT3" type="hidden"
                                           value="${declareModel.freight3}">
                                </td>
                            </tr>
                            <tr lang="PREMIUM_TR">
                                <td class="table_list_name">保费：</td>
                                <td colspan="7">
                                    <input id="PREMIUM1" name="premium1"
                                           value="${declareModel.premium1}"
                                           placeholder="--计算类型--" oninput="this.style.color='red'">
                                    <input id="PREMIUM2" name="premium2"
                                           value="${declareModel.premium2}"
                                           placeholder="--数量--" oninput="this.style.color='red'">
                                    <input id="PREMIUM3_SHOW" name="premium3"
                                           value="${declareModel.premium3}"
                                           placeholder="--币制--" oninput="this.style.color='red'">
                                    <input id="PREMIUM3" type="hidden"
                                           value="${declareModel.premium3}">
                                </td>

                            </tr>
                            <tr lang="OTHERFEEL_TR">
                                <td class="table_list_name">杂费：</td>
                                <td colspan="7">
                                    <input id="OTHERFEEL1" name="otherfee1"
                                           value="${declareModel.otherfee1}"
                                           placeholder="--计算类型--" oninput="this.style.color='red'">
                                    <input id="OTHERFEEL2" name="otherfee2"
                                           value="${declareModel.otherfee2}"
                                           placeholder="--数量--" oninput="this.style.color='red'">
                                    <input id="OTHERFEEL3_SHOW" name="otherfee3"
                                           value="${declareModel.otherfee3}" placeholder="--币制--"
                                           oninput="this.style.color='red'">
                                    <input id="OTHERFEEL3" type="hidden"
                                           value="${declareModel.otherfee3}">
                                </td>
                            </tr>
                            <tr>
                                <td class="table_list_name">成交方式：</td>
                                <td>
                                    <input id="DEAL_MODE_SHOW" name="deal_mode"
                                           value="${declareModel.deal_mode}"
                                           oninput="this.style.color='red'"><font
                                        color="red">*</font>
                                    <input id="DEAL_MODE" type="hidden"
                                           value="${declareModel.deal_mode}">
                                </td>
                                <td class="table_list_name" style="display: none;">生产厂家：</td>
                                <td style="display: none;">
                                    <input id="PRODUCE_FACTORY" name="produce_factory"
                                           value="${declareModel.produce_factory}"
                                           oninput="this.style.color='red'">
                                </td>
                                <td class="table_list_name">签约地点：</td>
                                <td>
                                    <input id="SIGNING_PLACE" name="singing_place"
                                           value="${declareModel.singing_place}"
                                           oninput="this.style.color='red'"/>
                                </td>
                                <td class="table_list_name">贸易国(地区)：</td>
                                <td>
                                    <input id="TRADING_COUNTRY" name="trading_country"
                                           value="${declareModel.trading_country}"/><font
                                        color="red">*</font>
                                    <input id="TRADING_COUNTRY_CODE" type="hidden"
                                           name="trading_country_code"
                                           value="${declareModel.trading_country_code}">
                                </td>
                            </tr>
                            <tr>
                                <td class="table_list_name">特殊关系确认：</td>
                                <td>
                                    <input id="SPECIAL_RELATIONSHIP_CONFIRM"><font
                                        color="red">*</font>
                                    <input id="SPECIAL_RELATIONSHIP_CONFIRM_CODE" type="hidden"
                                           name="special_relationship_confirm"
                                           value="${declareModel.special_relationship_confirm }">
                                </td>
                                <td class="table_list_name">价格影响确认：</td>
                                <td>
                                    <input id="PRICE_IMPACT_CONFIRM"><font color="red">*</font>
                                    <input id="PRICE_IMPACT_CONFIRM_CODE" type="hidden"
                                           name="price_impact_confirm"
                                           value="${declareModel.price_impact_confirm }">
                                </td>
                                <td class="table_list_name">支付特许权使用费确认：</td>
                                <td>
                                    <input id="PAYMENT_ROYALTIES_CONFIRM"><font color="red">*</font>
                                    <input id="PAYMENT_ROYALTIES_CONFIRM_CODE" type="hidden"
                                           name="payment_royaltils_confirm"
                                           value="${declareModel.payment_royaltils_confirm }">
                                </td>
                            </tr>
                            <tr>
                                <td class="table_list_name">备注：</td>
                                <td colspan="7">
                                    <input id="REMARK" style="width:90%" name="remark"
                                           value="${declareModel.remark}"
                                           oninput="this.style.color='red'">
                                    <input id="ARRIVED_PORT" type="hidden"
                                           name="arrived_port"
                                           value="${declareModel.arrived_port}">
                                    <input id="ARRIVED_PORT_CODE" type="hidden"
                                           name="arrived_port_code"
                                           value="${declareModel.arrived_port_code}">
                                    <input id="ARRIVED_COUNTRY" type="hidden"
                                           name="arrived_country"
                                           value="${declareModel.arrived_country}">
                                    <input id="ARRIVED_COUNTRY_CODE" type="hidden"
                                           name="arrived_country_code"
                                           value="${declareModel.arrived_country_code}">
                                </td>

                            </tr>
                            <tr>
                                <td colspan="8"><font color="red">说明：有标记红色*号为必填项!</font></td>
                            </tr>
                            <tr>
                                <td colspan="8" align="left">
                                    <div id="containInfo">
                                        <table>
                                            <tr>
                                                <td class="first_li">分柜资料附件：</td>
                                            </tr>
                                            <tr>
                                                <td><c:if
                                                        test="${not empty declare.containerInfo}">${declare.containerInfo.name}
                                                    <input
                                                            type="button"
                                                            value="删除附件"
                                                            onclick="cancleUploadAccess();"/></c:if><c:if
                                                        test="${empty declare.containerInfo}">上传</c:if>
                                                </td>
                                                <td><input type="button" value="选择文件"
                                                           onclick="uploadAccess();"/>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div id="upload_so" style="display:none;">
                                        SO信息：<span></span><input
                                            name="containerInfo.id"
                                            value="${declare.containerInfo.id}"
                                            id="containerInfoId" style="display:none;"/>
                                    </div>
                                    <div id="dialog002" style="display:none">
                                        <form id="uploadAccessoryForm"
                                              action="attach-upload?type=declare"
                                              enctype="multipart/form-data" method="POST">
                                            <input type="file" name="attach" value="选择文件"/>
                                            <input type="submit" value="上传"/>
                                        </form>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="8" align="center">
                                    <input type="button" value="查看修改随附单证"
                                           onclick="$('#sfd_temp_id').val(suifudate);window.open(
                                                   //TODO 找不到该方法
                                                   '<s:url
                                                   value="../sfd/main?tid"/>='+suifudate+'&did='+$('#declareId').val())">
                                    <input type="hidden" name="sfdTempId" id="sfd_temp_id">
                                    <input type="button" value="下一步" onclick="gotoTab();"></td>
                            </tr>
                        </table>
                    </div>
                </li>
            </ul>
        </c:if>
        <c:if test="${param.modelType ne '1'}">
            <ul>
                <li>
                    <div>
                        <h3 class="list_title">请填写出口信息：</h3>
                        <table style="width: 100%;">
                            <tr>
                                <td class="table_list_name">卖方：</td>
                                <td><input id="SELLER" name="seller"
                                           value="${declare.seller}"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">地址：</td>
                                <td><input id="SELLER_ADDRESS" name="seller_address"
                                           value="${declare.seller_address}"></td>
                                <td class="table_list_name">电话：</td>
                                <td><input id="SELLER_PHONE" name="seller_phone"
                                           value="${declare.seller_phone}"></td>
                                <td class="table_list_name">传真：</td>
                                <td><input id="SELLER_FAX" name="seller_fax"
                                           value="${declare.seller_fax}"></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">买方：</td>
                                <td><input id="BUYER" name="buyer" value="${declare.buyer}"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">境内货源地：</td>
                                <td>
                                    <input id="GOODS_ADDR_SHOW" name="goods_addr"
                                           value="${declare.goods_addr}"><font
                                        color="red">*</font>
                                    <input id="GOODS_ADDR" name="goods_addr_code"
                                           value="${declare.goods_addr_code}" type="hidden">
                                </td>

                                <td class="table_list_name">其他货源地：</td>
                                <td>
                                    <input id="OTHER_GOODS_ADDR_SHOW"
                                           name="other_goods_addr"
                                           value="${declare.other_goods_addr}"
                                           oninput="this.style.color='red'">
                                    <input id="OTHER_GOODS_ADDR" value="${declare.other_goods_addr}"
                                           type="hidden">
                                </td>


                                <!-- 					<td class="table_list_name">发货单位：</td> -->
                                <td class="table_list_name">生产销售单位：</td>
                                <td>
                                    <input id="FAHUO_COMPANY_NAME" name="fahuo_company_name"
                                           value="${declare.fahuo_company_name}"><font
                                        color="red">*</font>
                                    <input id="FAHUO_COMPANY_CO" type="hidden"
                                           name="fahuo_company_co"
                                           value="${declare.fahuo_company_co}">
                                    <input id="COMPANY_NAME" type="hidden"
                                           name="company_name"
                                           value="${declare.company_name}">
                                    <input id="COMPANY_CO" type="hidden" name="company_co"
                                           value="${declare.company_co}">
                                </td>
                            </tr>
                            <tr>
                                <td class="table_list_name">日期：</td>
                                    <%-- 				<td><input id="EXPORT_DATE" name="export_date" value="${declare.export_date}"></td> --%>
                                <td><input id="CONTRACT_DATE" name="contract_date"
                                           value='<fmt:formatDate value="${declare.contract_date}" pattern="yyyy-MM-dd" />'><font
                                        color="red">*</font></td>
                                <td class="table_list_name">合同协议号：</td>
                                <td><input id="CONTRACT_NO" name="contract_no"
                                           value="${declare.contract_no}"><font color="red">*</font>
                                </td>
                                <td class="table_list_name">发票号：</td>
                                <td><input id="INVOICE_NO" name="invoice_no"
                                           value="${declare.invoice_no}"><font
                                        color="red">*</font></td>
                                <td class="table_list_name">许可证号：</td>
                                <td><input id="LICENSE_NO" name="license_no"
                                           value="${declare.license_no}"></td>
                            </tr>
                            <tr>
                                <td class="table_list_name">征免性质：</td>
                                <td>
                                    <input id="LEVYMODE_SHOW" name="levymode"
                                           value="${declare.levymode}"><font
                                        color="red">*</font>
                                    <input id="LEVYMODE" type="hidden" name="levymode_code"
                                           value="${declare.levymode_code}">
                                </td>
                                <td class="table_list_name">包装种类：</td>
                                <td>
                                    <input id="GOODS_PACKAGE" name="goods_package"
                                           value="${declare.goods_package}">
                                    <input id="CONCRETE_GOODS_PACKAGE" style="display: none;"
                                           placeholder="请填写具体包装种类"
                                           name="concrete_goods_package"
                                           value="${declare.concrete_goods_package }"><font
                                        color="red">*</font>
                                </td>
                                <td class="table_list_name">
                                    <input type="radio" id="noWoodPackaging"
                                           name="is_wood_packaging" value="1">
                                </td>
                                <td>无木质包装声明</td>
                                <td class="table_list_name">
                                    <input type="radio" id="woodPackaging"
                                           name="is_wood_packaging" value="2">
                                </td>
                                <td>木质包装声明+合格证</td>
                            </tr>
                            <tr>
                                <td class="table_list_name">箱唛：</td>
                                <td>
                                    <input id="CARTON" name="carton"
                                           value="${declare.carton}">
                                    <input id="GOODS_COUNT" type="hidden" name="goods_count"
                                           value="${declare.goods_count}">
                                    <input id="GROSS_WEIGHT" type="hidden"
                                           name="gross_weight"
                                           value="${declare.gross_weight}">
                                    <input id="NET_WEIGHT" type="hidden" name="net_weight"
                                           value="${declare.net_weight}">
                                    <input id="TOTAL_MONEY" type="hidden" name="total_money"
                                           value="${declare.total_money}"/>
                                    <input id="SUM_COUNT" type="hidden" name="sum_count"
                                           value="${declare.sum_count}"/>
                                    <!-- 						运抵国 -->
                                    <input id="ARRIVED_COUNTRY_SHOW" type="hidden"
                                           value="${declare.arrived_country}">

                                    <!-- 						指运港 -->
                                    <input id="ARRIVED_PORT_SHOW" type="hidden"
                                           value="${declare.arrived_port}">
                                </td>
                                <td class="table_list_name">监管方式：</td>
                                <td>
                                    <input id="TRADE_MODE_SHOW" name="trade_mode"
                                           value="${declare.trade_mode}"><font
                                        color="red">*</font>
                                    <input id="TRADE_MODE" type="hidden"
                                           name="trade_mode_code"
                                           value="${declare.trade_mode_code}">
                                </td>
                                <td class="table_list_name">运输方式：</td>
                                <td>
                                    <input id="TRANSPORT_MODE" name="transport_mode"
                                           value="${declare.transport_mode}"><font
                                        color="red">*</font>
                                    <input name="transport_mode_code" type="hidden"
                                           value="${declareModel.transport_mode_code}"/>
                                </td>
                                <td class="table_list_name">结汇方式：</td>
                                <td>
                                    <input id="LC_TYPE_SHOW" name="lc_type"
                                           value="${declare.lc_type}"><font
                                        color="red">*</font>
                                    <input id="LC_TYPE" type="hidden" value="${declare.lc_type}">
                                </td>

                                <td colspan="2"></td>
                                <!-- <td colspan="4" align="center"><input type="checkbox" >无木质包装声明</td>
					<td colspan="4" align="center"><input type="checkbox" >木质包装声明+合格证</td> -->
                            </tr>
                            <tr>
                                <td class="table_list_name">成交方式：</td>
                                <td>
                                    <input id="DEAL_MODE_SHOW" name="deal_mode"
                                           value="${declare.deal_mode}"><font color="red">*</font>
                                    <input id="DEAL_MODE" type="hidden"
                                           value="${declare.deal_mode}">
                                </td>
                                <td class="table_list_name" style="display: none;">生产厂家：</td>
                                <td style="display: none;">
                                    <input id="PRODUCE_FACTORY" name="produce_factory"
                                           value="${declare.produce_factory}" type="hidden">
                                </td>
                                <td class="table_list_name">签约地点：</td>
                                <td>
                                    <input id="SIGNING_PLACE" name="singing_place"
                                           value="${declare.singing_place}"/>
                                </td>
                                <td class="table_list_name">贸易国(地区)：</td>
                                <td>
                                    <input id="TRADING_COUNTRY" name="trading_country"
                                           value="${declare.trading_country}"/><font
                                        color="red">*</font>
                                    <input id="TRADING_COUNTRY_CODE" type="hidden"
                                           name="trading_country_code"
                                           value="${declare.trading_country_code}">
                                </td>
                            </tr>
                            <tr lang="FREIGHT_TR">
                                <td class="table_list_name">运费：</td>
                                <td colspan="7">
                                    <input id="FREIGHT1" name="freight1"
                                           value="${declare.freight1}"
                                           placeholder="--计算类型--">
                                    <input id="FREIGHT2" name="freight2"
                                           value="${declare.freight2}"
                                           placeholder="--数量--">
                                    <input id="FREIGHT3_SHOW" name="freight3"
                                           value="${declare.freight3}"
                                           placeholder="--币制--">
                                    <input id="FREIGHT3" type="hidden" value="${declare.freight3}">
                                </td>
                            </tr>
                            <tr lang="PREMIUM_TR">
                                <td class="table_list_name">保费：</td>
                                <td colspan="7">
                                    <input id="PREMIUM1" name="premium1"
                                           value="${declare.premium1}"
                                           placeholder="--计算类型--">
                                    <input id="PREMIUM2" name="premium2"
                                           value="${declare.premium2}"
                                           placeholder="--数量--">
                                    <input id="PREMIUM3_SHOW" name="premium3"
                                           value="${declare.premium3}"
                                           placeholder="--币制--">
                                    <input id="PREMIUM3" type="hidden" value="${declare.premium3}">
                                </td>

                            </tr>
                            <tr lang="OTHERFEEL_TR">
                                <td class="table_list_name">杂费：</td>
                                <td colspan="7">
                                    <input id="OTHERFEEL1" name="otherfee1"
                                           value="${declare.otherfee1}"
                                           placeholder="--计算类型--">
                                    <input id="OTHERFEEL2" name="otherfee2"
                                           value="${declare.otherfee2}"
                                           placeholder="--数量--">
                                    <input id="OTHERFEEL3_SHOW" name="otherfee3"
                                           value="${declare.otherfee3}"
                                           placeholder="--币制--">
                                    <input id="OTHERFEEL3" type="hidden"
                                           value="${declare.otherfee3}">
                                </td>
                            </tr>
                            <tr>
                                <td class="table_list_name">特殊关系确认：</td>
                                <td>
                                    <input id="SPECIAL_RELATIONSHIP_CONFIRM"><font
                                        color="red">*</font>
                                    <input id="SPECIAL_RELATIONSHIP_CONFIRM_CODE" type="hidden"
                                           name="special_relationship_confirm"
                                           value="${declare.special_relationship_confirm }">
                                </td>
                                <td class="table_list_name">价格影响确认：</td>
                                <td>
                                    <input id="PRICE_IMPACT_CONFIRM"><font color="red">*</font>
                                    <input id="PRICE_IMPACT_CONFIRM_CODE" type="hidden"
                                           name="price_impact_confirm"
                                           value="${declare.price_impact_confirm }">
                                </td>
                                <td class="table_list_name">支付特许权使用费确认：</td>
                                <td>
                                    <input id="PAYMENT_ROYALTIES_CONFIRM"><font color="red">*</font>
                                    <input id="PAYMENT_ROYALTIES_CONFIRM_CODE" type="hidden"
                                           name="payment_royaltils_confirm"
                                           value="${declare.payment_royaltils_confirm }">
                                </td>
                            </tr>
                            <tr>
                                <td class="table_list_name">备注：</td>
                                <td colspan="7">
                                    <input id="REMARK" style="width:90%" name="remark"
                                           value="${declare.remark}">
                                    <input id="ARRIVED_PORT" type="hidden"
                                           name="arrived_port"
                                           value="${declare.arrived_port}">
                                    <input id="ARRIVED_PORT_CODE" type="hidden"
                                           name="arrived_port_code"
                                           value="${declare.arrived_port_code}">
                                    <input id="ARRIVED_COUNTRY" type="hidden"
                                           name="arrived_country"
                                           value="${declare.arrived_country}">
                                    <input id="ARRIVED_COUNTRY_CODE" type="hidden"
                                           name="arrived_country_code"
                                           value="${declare.arrived_country_code}">
                                </td>

                            </tr>
                            <tr>
                                <td colspan="8"><font color="red">说明：有标记红色*号为必填项!</font></td>
                            </tr>
                            <tr>
                                <td colspan="8" align="center">
                                    <input type="button" value="查看修改随附单证"
                                           onclick="$('#sfd_temp_id').val(suifudate);window.open(
                                                   '<s:url
                                                   value="../sfd/main?"/>tid='+suifudate+'&did='+$('#declareId').val())">
                                    <input type="hidden" name="sfdTempId" id="sfd_temp_id">

                                    <input type="button" value="下一步" onclick="gotoTab();"></td>
                            </tr>
                        </table>
                    </div>

                </li>
            </ul>
        </c:if>

        <!-- 第三步 -->
        <ul>
            <li>
                <div>
                    <h3 class="list_title">请复核报关信息：</h3>
                    <table style="width: 100%;">
                        <tr>
                            <td class="table_list_name">卖方：</td>
                            <td><label></label></td>
                            <td class="table_list_name">地址：</td>
                            <td><label></label></td>
                            <td class="table_list_name">电话：</td>
                            <td><label></label></td>
                            <td class="table_list_name">传真：</td>
                            <td><label></label></td>
                        </tr>
                        <tr>
                            <td class="table_list_name">买方：</td>
                            <td><label></label></td>
                            <td class="table_list_name">境内货源地：</td>
                            <td><label></label></td>
                            <td class="table_list_name">发货单位：</td>
                            <td><label></label></td>
                            <td class="table_list_name">日期：</td>
                            <td><label></label></td>
                        </tr>
                        <tr>
                            <td class="table_list_name">合同协议号：</td>
                            <td><label></label></td>
                            <td class="table_list_name">发票号：</td>
                            <td><label></label></td>
                            <td class="table_list_name">许可证号：</td>
                            <td><label></label></td>
                            <td class="table_list_name">征免性质：</td>
                            <td><label></label></td>
                        </tr>
                        <tr>
                            <td class="table_list_name">运抵国：</td>
                            <td>
                                <label></label>
                            </td>
                            <td class="table_list_name">指运港：</td>
                            <td>
                                <label></label>
                            </td>
                            <td class="table_list_name">总净重：</td>
                            <td><label id="sum_net_weight"></label></td>
                            <td class="table_list_name">总毛重：</td>
                            <td><label id="sum_gross_weight"></label></td>
                        </tr>
                        <tr>
                            <td class="table_list_name">包装种类：</td>
                            <td><label></label></td>
                            <td align="center"><label></label></td>
                            <td align="center"><label></label></td>
                            <td class="table_list_name">箱唛：</td>
                            <td><label></label></td>
                            <td class="table_list_name">件数：</td>
                            <td><label id="sum_goods_number"></label></td>
                            <td colspan="2"></td>
                        </tr>
                        <tr>
                            <td class="table_list_name">监管方式：</td>
                            <td><label></label></td>
                            <td class="table_list_name">运输方式：</td>
                            <td><label></label></td>
                            <td class="table_list_name">结汇方式：</td>
                            <td><label></label></td>
                            <td class="table_list_name">成交方式：</td>
                            <td><label></label></td>
                            <td colspan="2"></td>
                        </tr>
                        <tr lang="FREIGHT_TR">
                            <td class="table_list_name">运费：</td>
                            <td colspan="7">
                                <label></label>
                                <label></label>
                                <label></label>
                            </td>
                        </tr>
                        <tr lang="PREMIUM_TR">
                            <td class="table_list_name">保费：</td>
                            <td colspan="7">
                                <label></label>
                                <label></label>
                                <label></label>
                            </td>

                        </tr>
                        <tr lang="OTHERFEEL_TR">
                            <td class="table_list_name">杂费：</td>
                            <td colspan="7">
                                <label></label>
                                <label></label>
                                <label></label>
                            </td>
                        </tr>
                        <tr>
                            <td class="table_list_name">备注：</td>
                            <td colspan="7"><label></label></td>
                        </tr>
                    </table>
                </div>
            </li>
        </ul>
    </div>
    <c:if test="${not empty declare.id}">
        <c:if test="${declare.state eq 'DS01' || declare.state eq 'DS02' || declare.state eq 'DS04' || declare.state eq 'DS05'}">
            <tr>
                <td colspan="8" align="left">
                    <div id="containInfo">
                        <table>
                            <tr>
                                <td class="first_li">分柜资料附件：</td>
                            </tr>
                            <tr>
                                <td>
                                    <c:if test="${empty declare.containerInfo}">
                                        没有文件下载
                                    </c:if>
                                    <c:if test="${not empty declare.containerInfo}">
                                        ${declare.containerInfo.name}
                                        <a href="download?attachment.id=${declare.containerInfo.id}/>"
                                           target="_blank">
                                            <img style="vertical-align: middle; cursor: pointer;"
                                                 src='<s:url value="../img/fileDownload.png"/>'/>
                                        </a>
                                    </c:if>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </c:if>
        <c:if test="${not (declare.state eq 'DS01' || declare.state eq 'DS02' || declare.state eq 'DS04' || declare.state eq 'DS05')}">
            <tr>
                <td colspan="8" align="left">
                    <div id="containInfo">
                        <table>
                            <tr>
                                <td class="first_li">分柜资料附件：</td>
                            </tr>
                            <tr>
                                <td><c:if
                                        test="${not empty declare.containerInfo}">${declare.containerInfo.name}
                                    <input type="button"
                                           value="删除附件"
                                           onclick="cancleUploadAccess();"/></c:if>
                                    <c:if test="${empty declare.containerInfo}">上传</c:if>
                                </td>
                                <td><input type="button" value="选择文件"
                                           onclick="uploadAccess();"/></td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </c:if>
    </c:if>

    <c:if test="${declare.state eq 'DS03'}">
        <div>
            <fieldset>
                <legend class="list_title1">业务单错误报告</legend>
                <table class="dataTD list_title1" width="100%" style="background-color: #DFF0F8;">
                    <c:forEach var="de" items="${rejectContentList}" varStatus="rc">
                        <tr>
                            <td>${rc.index+1}、${de.content}</td>
                        </tr>
                        <tr>
                            <td align="right">${de.rejectPerson}&nbsp;&nbsp;&nbsp;<fmt:formatDate
                                    value="${de.rejectDate}" pattern="yyyy-MM-dd hh:mm:ss"/></td>
                        </tr>
                    </c:forEach>
                </table>
            </fieldset>
        </div>
    </c:if>


</div>
<!-- </form> -->
</body>
</html>
